Skip to content

Reference

platform.tools_api

API to interact with the tools API. To list available methods in this module, use:

from deeporigin.platform import tools_api
tools_api.__all__

src.platform.tools_api

bridge module to interact with the platform tools api

Attributes

NON_FAILED_STATES module-attribute

NON_FAILED_STATES = {
    "Succeeded",
    "Running",
    "Queued",
    "Created",
}

NON_TERMINAL_STATES module-attribute

NON_TERMINAL_STATES = {'Created', 'Queued', 'Running'}

PROVIDER module-attribute

PROVIDER = Literal['ufa', 's3']

TERMINAL_STATES module-attribute

TERMINAL_STATES = {'Succeeded', 'Failed', 'Cancelled'}

Functions

cancel_run

cancel_run(
    execution_id: str,
    *,
    client=None,
    org_key: Optional[str] = None
) -> None

cancel a run

Parameters:

Name Type Description Default
execution_id str

execution ID

required

cancel_runs

cancel_runs(
    job_ids: list[str] | Series | DataFrame,
    *,
    client=None,
    org_key: Optional[str] = None
) -> None

Cancel multiple jobs in parallel.

Parameters:

Name Type Description Default
job_ids list[str] | Series | DataFrame

List of job IDs to cancel.

required

generate_tool_function

generate_tool_function(
    *,
    tool_key: str,
    tool_version: str,
    org_key: Optional[str] = None
) -> Callable

utility function that generates a function that can be used to run a too, from schema

Example usage:

docking_func = tools_api.generate_tool_function(tool_key="deeporigin.bulk-docking", tool_version="0.3.0")
docking_func(
    protein_path="path/to/protein.pdb",
    ligand_path="path/to/ligand.sdf",
    ...
)

get_status_and_progress

get_status_and_progress(
    execution_id: str,
    *,
    client=None,
    org_key: Optional[str] = None
) -> dict

Determine the status of a run, identified by job ID

Parameters:

Name Type Description Default
execution_id str

execution_id

required

get_statuses_and_progress

get_statuses_and_progress(
    job_ids: list[str],
    *,
    client=None,
    org_key: Optional[str] = None
) -> list

get statuses and progress reports for multiple jobs in parallel

Parameters:

Name Type Description Default
job_ids list[str]

list of job IDs

required

query_run_status

query_run_status(
    execution_id: str,
    *,
    client=None,
    org_key: Optional[str] = None
) -> str

Determine the status of a run, identified by execution_id ID

Parameters:

Name Type Description Default
execution_id str

execution_id ID

required

Returns:

Type Description
str

One of "Created", "Queued", "Running", "Succeeded", or "Failed"

query_run_statuses

query_run_statuses(
    job_ids: list[str],
    *,
    client=None,
    org_key: Optional[str] = None
) -> dict

get statuses for multiple jobs in parallel

Parameters:

Name Type Description Default
job_ids list[str]

list of job IDs

required

run_tool

run_tool(
    *,
    data: dict,
    tool_key: str,
    client=None,
    org_key: Optional[str] = None
)

run any tool using provided data transfer object (DTO)

Parameters:

Name Type Description Default
data dict

data transfer object. This is typically generated by the make_payload function.

required