Skip to content

FunctionResult

All functions (and class methods that wrap them, like protein.dock()) return a FunctionResult. This object wraps the raw API response and provides convenient access to cost, estimate, and function outputs.

For batch operations (e.g. docking multiple ligands), a single FunctionResult aggregates responses from all individual calls, summing costs and estimates automatically.

Quick reference

# Run a function
result = protein.dock(pocket=pocket, ligand=ligand)
result.cost       # actual cost in dollars
result.poses      # domain-specific output (LigandSet for docking)

# Estimate cost without running
result = protein.dock(pocket=pocket, ligand=ligand, quote=True)
result.estimate   # estimated cost in dollars
result.cost       # None

API Reference

src.functions.result.FunctionResult dataclass

Wraps function API responses with convenient accessors.

Holds a list of responses so that batch runs (e.g. docking many ligands) can aggregate costs and estimates naturally. Callers can attach domain-specific attributes directly on the instance (e.g. result.poses = LigandSet(...)).

Attributes:

Name Type Description
_responses list[dict]

List of raw JSON response dicts from the function API.

Attributes

response property

response: dict

The first raw API response (convenience for single-response results).

responses property

responses: list[dict]

All raw API response dictionaries.

status property

status: str | None

Execution status from the first response.

id property

id: str | None

The execution ID from the first response.

estimate property

estimate: float | None

Total cost estimate in dollars (set when quote=True was used).

Returns 0.0 when the platform quotes a zero price (e.g. free tier). Returns None when no successful quotation with a priceTotal is present.

cost property

cost: float | None

Total actual cost in dollars (set when the function was executed).

function_outputs property

function_outputs: list[dict]

The functionOutputs dicts from all responses.

function_key property

function_key: str | None

The function key (e.g. 'deeporigin.docking') from the first response.

function_version property

function_version: str | None

The function version from the first response.