Skip to Content

openprotein.jobs

SDK release/v0.18.0

Use session.jobs.list(...) and session.jobs.get_job(...) to inspect job records. Use session.jobs.get(...) to load a future and read its results. A job record describes the submission and its status; the future provides the result-reading methods.

wait_until_done() waits for a terminal status and does not establish success: a failed or canceled job is also done. It does not fetch results. Check the job status before interpreting completion; result readers have their own failure and timeout behavior.

Given a stored job ID, refresh and check the status before reading results:

from openprotein.errors import AuthError, JobFailedException, TimeoutException
from openprotein.jobs import JobStatus

try:
    future = session.jobs.get(job_id)
    future.wait_until_done(timeout=600)
    if future.status == JobStatus.SUCCESS:
        results = future.get()
    else:
        print("Job ended:", future.status, future.job.failure_message)
except TimeoutException as error:
    print("Polling timed out:", error)
except JobFailedException as error:
    print("Job failed:", error)
except AuthError as error:
    print("Authentication failed:", error)

refresh() updates the stored job record; wait_until_done() polls and updates it without reading results. The base Future.get() raises JobFailedException for FAILURE; some specialized readers have their own checks. TimeoutException covers polling timeouts. Network requests can also raise requests.exceptions.Timeout, an API HTTPError, or openprotein.base.TimeoutError for a gateway timeout. A timeout does not imply that the job was canceled.

An API request can raise APIError; reading a failed position can also surface APIError. FutureUnit.wait() raises RuntimeError for a failed or canceled unit; FutureUnit.get() delegates to get_item() without that state check. For an output collection or page read (job_output_page), HTTP 409 is translated to JobOutputsNotReady; a per-position read (job_output_get) does not perform that translation and leaves the HTTPError. InvalidJob indicates a missing or invalid job. NotPrepared is exported, but no public method raises it. These paths do not imply that every result reader raises JobFailedException.

7source

wait_until_done() returns true for any terminal status, including failure or cancellation, not only successful completion as the pinned member docstring says. Check status for success.

21source

5source

7source

2source

3source

source

1source

Batch jobs, outputs and units describe submitted tasks and their results.

RecordFieldMeaning
BatchJobnum_recordsNumber of records in the batch, when known.
UnitpositionPosition of this unit in the job.
Unitunit_idUnit identifier.
UnitstateCurrent unit execution state.
UniterrorError details, when present.

4source

6source

3source

Use job from the ESM2 embedding example and choose a read based on what you need:

Every position. wait() waits for the job and reads its primary output, with one value per submitted position. Use get() if the job has already succeeded.

embeddings = job.wait(timeout=600)
print(embeddings[0].shape)

One position. Use a zero-based position. unit(0).wait() waits for and reads just the first result. If that result is already available, use get_item(0).

embedding = job.unit(0).wait(timeout=600)
print(embedding.shape)

One named output. Check job.outputs for the names this job provides. Pass output= to select one by name. Different outputs can have different types. For this ESM2 job, embeddings is the primary output.

print(job.outputs)
embeddings = job.wait(output="embeddings", timeout=600)
print(embeddings[0].shape)

See the primary outputs and result types for other model tasks.

29source

8source

29source

29source

29source

29source

29source

29source

29source

29source

29source

29source

29source

SVDFitFuture, UMAPFitFuture and GPFitFuture return the fitted model from bare get() and wait() calls. With output=..., these methods return values for the selected fit output. CrossvalidateFuture returns CrossvalidateResults, parallel arrays with one row per sequence and measurement.

31source

31source

29source

29source

7source

3source

Job records and reloading

Model-task records use Job. Supported task records reload through session.jobs.get(...) as the corresponding task future. A reloaded job does not always retain the exact future class returned at submission: GP training uses PredictorModel, GP cross-validation uses CVResultFuture, and prompt sampling uses the compatibility Prompt reader. Refer to each reader's result contract.

On this page