jobs

Client API for jobs in Nexus.

enum qnexus.client.jobs.RemoteRetryStrategy(
value,
)

Strategy to use when retrying jobs.

Each strategy defines how the system should approach resolving potential conflicts with remote state.

DEFAULT will only attempt to re-sync status and collect results from the third party. Duplicate results will not be saved.

ALLOW_RESUBMIT will submit the job to the third party again if # the system has no record of a third party handle.

FORCE_RESUBMIT will submit the job to the third party again if the system has a job handle already but no result.

FULL_RESTART will act as though the job is entirely fresh and re-perform every action.

Member Type:

str

Valid values are as follows:

DEFAULT = <RemoteRetryStrategy.DEFAULT: 'DEFAULT'>
ALLOW_RESUBMIT = <RemoteRetryStrategy.ALLOW_RESUBMIT: 'ALLOW_RESUBMIT'>
FORCE_RESUBMIT = <RemoteRetryStrategy.FORCE_RESUBMIT: 'FORCE_RESUBMIT'>
FULL_RESTART = <RemoteRetryStrategy.FULL_RESTART: 'FULL_RESTART'>
qnexus.client.jobs.cancel(
job: JobRef,
)

Attempt cancellation of a job in Nexus.

If the job has been submitted to a backend, Nexus will request cancellation of the job.

qnexus.client.jobs.get(
id: str | UUID | None = None,
name_like: str | None = None,
creator_email: list[str] | None = None,
project: ProjectRef | None = None,
properties: OrderedDict[str, bool | int | float | str] | None = None,
job_status: list[JobStatusEnum] | None = None,
job_type: list[JobType] | None = None,
created_before: datetime | None = None,
created_after: datetime | None = datetime.datetime(2023, 1, 1, 0, 0),
modified_before: datetime | None = None,
modified_after: datetime | None = None,
sort_filters: list[SortFilterEnum] | None = None,
page_number: int | None = None,
page_size: int | None = None,
) JobRef

Get a single job using filters. Throws an exception if the filters do not match exactly one object.

qnexus.client.jobs.get_all(
name_like: str | None = None,
creator_email: list[str] | None = None,
project: ProjectRef | None = None,
properties: OrderedDict[str, bool | int | float | str] | None = None,
job_status: list[JobStatusEnum] | None = None,
job_type: list[JobType] | None = None,
created_before: datetime | None = None,
created_after: datetime | None = datetime.datetime(2023, 1, 1, 0, 0),
modified_before: datetime | None = None,
modified_after: datetime | None = None,
sort_filters: list[SortFilterEnum] | None = None,
page_number: int | None = None,
page_size: int | None = None,
) NexusIterator[CompileJobRef | ExecuteJobRef]

Get a NexusIterator over jobs with optional filters.

async qnexus.client.jobs.listen_job_status(
job: JobRef,
wait_for_status: StatusEnum = StatusEnum.COMPLETED,
) JobStatus

Check the Status of a Job via a websocket connection. Will use SSO tokens.

qnexus.client.jobs.results(
job: CompileJobRef,
) DataframableList[CompilationResultRef]
qnexus.client.jobs.results(
job: ExecuteJobRef,
) DataframableList[ExecutionResultRef]

Get the ResultRefs from a JobRef, if the job is complete.

qnexus.client.jobs.retry_submission(
job: JobRef,
retry_status: list[StatusEnum] | None = None,
remote_retry_strategy: RemoteRetryStrategy = RemoteRetryStrategy.DEFAULT,
user_group: str | None = None,
)

Retry a job in Nexus according to status(es) or retry strategy.

By default, jobs with the ERROR status will be retried.

qnexus.client.jobs.status(
job: JobRef,
) JobStatus

Get the status of a job.

qnexus.client.jobs.wait_for(
job: JobRef,
wait_for_status: StatusEnum = StatusEnum.COMPLETED,
timeout: float | None = 300.0,
) JobStatus

Check job status until the job is complete (or a specified status).

enum qnexus.jobs.StatusEnum(
value,
)

Enumeration for the possible status of a circuit submitted to a backend.

Valid values are as follows:

COMPLETED = <StatusEnum.COMPLETED: 'Circuit has completed. Results are ready.'>
QUEUED = <StatusEnum.QUEUED: 'Circuit is queued.'>
SUBMITTED = <StatusEnum.SUBMITTED: 'Circuit has been submitted.'>
RUNNING = <StatusEnum.RUNNING: 'Circuit is running.'>
RETRYING = <StatusEnum.RETRYING: 'Circuit is being retried.'>
CANCELLING = <StatusEnum.CANCELLING: 'Cancellation has been requested.'>
CANCELLED = <StatusEnum.CANCELLED: 'Circuit has been cancelled.'>
ERROR = <StatusEnum.ERROR: 'Circuit has errored. Check CircuitStatus.message for error message.'>
enum qnexus.jobs.JobStatusEnum(
value,
)

Possible job statuses

Member Type:

str

Valid values are as follows:

COMPLETED = <JobStatusEnum.COMPLETED: 'COMPLETED'>
QUEUED = <JobStatusEnum.QUEUED: 'QUEUED'>
SUBMITTED = <JobStatusEnum.SUBMITTED: 'SUBMITTED'>
RUNNING = <JobStatusEnum.RUNNING: 'RUNNING'>
CANCELLED = <JobStatusEnum.CANCELLED: 'CANCELLED'>
ERROR = <JobStatusEnum.ERROR: 'ERROR'>
class qnexus.jobs.JobRef(
*,
id: UUID,
annotations: Annotations,
job_type: JobType,
last_status: StatusEnum,
last_message: str,
project: ProjectRef,
type: Literal['JobRef', 'CompileJobRef', 'ExecuteJobRef'] = 'JobRef',
)

Proxy object to a Job in Nexus.

df() DataFrame

Present in a pandas DataFrame.

enum qnexus.jobs.JobType(
value,
)

Enum for a job’s type.

Member Type:

str

Valid values are as follows:

EXECUTE = <JobType.EXECUTE: 'execute'>
COMPILE = <JobType.COMPILE: 'compile'>