Bases: protocolinterface.protocolinterface.ProtocolInterface
Create a Job object given the user session and an app id.
session (Session) – The user session
appid (str) – The app ID
execid (str) – The ID of the job if it has already been submited
job_json (dict) – A dictionary from which to instantiate the job. Useful when creating a job from data from the API
strict (bool) – If strict is True, Job creation will fail if not able to load correctly existing app configuration into the Job.
Cancel the job
Cancels the job. This will set the status to ERROR and stop any running execution (children as well)
Describes the input parameters of an application
Returns the children of the job.
children – The children of the job
Get information related to an errored job
Prints the job progress.
_logger (bool) – Set as True for printing the info and errors in sys.stdout. If False, it returns the same information as an object (default=True).
info (str) – The information on the current progress
completion (str) – The completion percentage
Prints or returns the job status
Reads argument values of the job from a json or yaml file
Retrieve the results of a job execution.
The output will be retrieved in the working directory if the argument path is not passed, inside a folder with the id job as a name. If this folder already exists, another one with a timestamp will be created. If the job has not completed, the function will try to download intermediate results.
path (str) – Destination folder
force (bool) – If the destination folder exists and force == True, the destination folder will be removed.
skip (bool) – If the destination folder exists and skip == True, nothing will be performed.
on_status (list or JobStatus) – Restrict at which job status the results will be retrieved
attempts (int) – How many times to attempt downloading the data from minio
execid_subdir (bool) – If True it will create a subdirectory inside path with the execution ID as name and retrieve the results there
tmpdir (str) – Set a different directory for storing temporary files. If set to None it defaults to /tmp/
_logger (bool) – Set as True for printing the info and errors in sys.stdout. If False, it returns the same information as an object (default=True).
path – The destination path of the retrieved data
Examples
>>> job.retrieve("./results/", on_status=(JobStatus.COMPLETED, JobStatus.ERROR))
Submits the job to the PlayMolecule backend server.
child_of (str) – The id of another job. If provided, the new job will be submited as a child of that job.
queue_config (dict) – A dictionary containing key-value pairs for defailed configuration for this job on the queueing system. You can specify “cpus”, “memory” and “priority” for the job.
_logger (bool) – Set to False to reduce verbosity
Examples
>>> job = sess.start_app("proteinprepare")
>>> job.pdbid = "3ptb"
>>> job.submit(queue_config={"ncpu": 2, "memory": 4000, "priority": 500})
Blocks execution until the job has reached the specific status or any of a list of statuses.
Blocks execution until all the children of the job have reached the given status
Writes the current argument values of the job to a json or yaml file
Bases: enum.IntEnum
Job status codes describing the current status of a job
WAITING_DATA : Waiting for communication fromm the job. Job has not reached the queue yet for computation. VALIDATING : Job is pending validation by admins WAITING_APPROVAL : Job is pending approval by admins RUNNING : Job is currently running COMPLETED : Job has successfully completed ERROR : Job has exited with an error QUEUED : Job is queued for execution SLEEPING : Job is sleeping and will be respawned soon. Used by periodically executing apps.
Bases: protocolinterface.validators._Validator
Returns the short execution ID of a job from the full execution ID