Skip to content

TrackedJob

TrackedJob

TrackedJob(record, handle, registry)

Reconnectable job handle that refreshes its cached status.

Obtain this from connect(); ordinary callers need not construct it directly.

Attributes:

Name Type Description
id str

Provider job UUID.

record JobRecord

Cached record, updated by status().

Example
from femora.jobs import connect
job = connect("YOUR_CACHED_JOB_UUID")  # May prompt for login.
print(job.status().state)

Methods:

Name Description
status

Fetch live remote status and update the local record.

details

Refresh status and fetch provider-specific job details.

wait

Poll until succeeded, failed, or cancelled; do not resubmit the job.

cancel

Request remote cancellation; poll status() to confirm its outcome.

download

Download a terminated job's outputs without extracting them.

cleanup_plan

Inspect validated remote output locations without deleting them.

cleanup

Delete remote outputs after revalidating an inspected cleanup plan.

Methods:

status

status()

Fetch live remote status and update the local record.

Returns:

Name Type Description
status JobStatus

Normalized and provider-native states.

Note

This contacts the provider; network and authorization errors propagate.

details

details()

Refresh status and fetch provider-specific job details.

Returns:

Name Type Description
details dict

Adapter details, or an empty dict if unavailable.

wait

wait(poll_interval=30, timeout=None)

Poll until succeeded, failed, or cancelled; do not resubmit the job.

Parameters:

Name Type Description Default
poll_interval float

Seconds between queries; at least one.

30
timeout float | None

Maximum elapsed seconds, or None for no limit.

None

Returns:

Name Type Description
status JobStatus

Terminal status, including failure or cancellation.

Raises:

Type Description
ValueError

Polling interval or timeout is invalid.

TimeoutError

Timeout elapsed; the remote job is left unchanged.

cancel

cancel()

Request remote cancellation; poll status() to confirm its outcome.

Warning

This affects a real remote job. It does not remove downloaded files or confirm immediate cancellation.

download

download(destination, progress=None)

Download a terminated job's outputs without extracting them.

Parameters:

Name Type Description Default
destination str | Path

New ZIP file path, not an extraction directory.

required
progress Callable | None

Optional callback receiving phase, count, total; total may be None while receiving.

None

Returns:

Name Type Description
archive Path

Downloaded archive path.

Raises:

Type Description
ValueError

TACC job is still active or the response archive is invalid.

FileExistsError

Destination or its .part file already exists.

Note

Failed downloads can leave a .part file for inspection. This does not delete remote output or retry automatically.

cleanup_plan

cleanup_plan()

Inspect validated remote output locations without deleting them.

Returns:

Name Type Description
plan JobCleanupPlan

Exact job-owned paths for supported TACC cleanup.

Raises:

Type Description
ValueError

Ownership, finished state, or supported paths cannot be verified.

cleanup

cleanup(expected)

Delete remote outputs after revalidating an inspected cleanup plan.

Parameters:

Name Type Description Default
expected JobCleanupPlan

Previously reviewed cleanup_plan() result.

required

Returns:

Name Type Description
removed tuple[str, ...]

Deleted remote directory paths.

Raises:

Type Description
ValueError

The plan changed or safe ownership/path checks fail.

Warning

Permanently deletes supported scratch/archive folders and hides the remote job. Download needed outputs first. This is not local hiding.