URLs#

Helpers that build links to pages in the Ionworks web app (https://app.ionworks.com).

Frontend URL helpers for the Ionworks web app.

This module provides the UrlsClient, which builds links to pages in the Ionworks web app without requiring callers to hand-construct URLs from entity IDs.

Every method takes the resource’s own ID plus whatever parent IDs the route requires, with project_id resolved from the explicit argument, else the project_id configured on the Ionworks client (which itself comes from the IONWORKS_PROJECT_ID env var).

The web-app host is derived from the client’s api_url so links point at the same environment the client talks to (api.ionworks.com → app.ionworks.com, stage-api.ionworks.com → stage.ionworks.com, etc.). Set IONWORKS_APP_URL to override — needed for local development, where the frontend runs on a different port than the API and so cannot be derived.

class ionworks.urls.UrlsClient(client)[source]#

Bases: object

Build links to pages in the Ionworks web app.

Returned URLs point at the environment the client is configured for, derived from its api_url (override with IONWORKS_APP_URL).

Parameters:

client (Ionworks)

__init__(client)[source]#
Parameters:

client (Ionworks)

Return type:

None

project(project_id=None)[source]#

Build a link to a project’s landing page.

The web app has no bare project route; opening a project lands on its studies page (/dashboard/projects/{p}/studies), so this returns that URL.

Parameters:

project_id (str | None, optional) – The project ID. Defaults to the project_id set on the Ionworks client (resolved from the IONWORKS_PROJECT_ID env var if not passed to the client).

Returns:

URL of the project’s studies landing page.

Return type:

str

model(model_id, project_id=None)[source]#

Build a link to a model detail page.

Parameters:
  • model_id (str) – The model ID.

  • project_id (str | None, optional) – The project ID the model belongs to. Defaults to the client’s project_id.

Returns:

URL of the model detail page.

Return type:

str

parameterized_model(parameterized_model_id, project_id=None)[source]#

Build a link to a parameterized model detail page.

Parameters:
  • parameterized_model_id (str) – The parameterized model ID.

  • project_id (str | None, optional) – The project ID the parameterized model belongs to. Defaults to the client’s project_id.

Returns:

URL of the parameterized model detail page.

Return type:

str

optimization(optimization_id, project_id=None)[source]#

Build a link to an optimization detail page.

Parameters:
  • optimization_id (str) – The optimization ID.

  • project_id (str | None, optional) – The project ID the optimization belongs to. Defaults to the client’s project_id.

Returns:

URL of the optimization detail page.

Return type:

str

pipeline(pipeline_id, project_id=None)[source]#

Build a link to a pipeline detail page.

Parameters:
  • pipeline_id (str) – The pipeline ID.

  • project_id (str | None, optional) – The project ID the pipeline belongs to. Defaults to the client’s project_id.

Returns:

URL of the pipeline detail page.

Return type:

str

study(study_id, project_id=None)[source]#

Build a link to a study detail page.

Parameters:
  • study_id (str) – The study ID.

  • project_id (str | None, optional) – The project ID the study belongs to. Defaults to the client’s project_id.

Returns:

URL of the study detail page.

Return type:

str

simulation(simulation_id, parameterized_model_id=None, project_id=None)[source]#

Build a link to a simulation detail page (parameterized-model view).

A simulation’s natural owner is its parameterized model — the simulation row carries a parameterized_model_id (one per simulation), so this method builds the parameterized-model-nested route. When parameterized_model_id is not supplied, it is fetched from the simulation via client.simulation.get(simulation_id).

Parameters:
  • simulation_id (str) – The simulation ID.

  • parameterized_model_id (str | None, optional) – The parameterized model the simulation belongs to. When omitted, it is derived by fetching the simulation (one network call).

  • project_id (str | None, optional) – The project ID the simulation belongs to. Defaults to the client’s project_id.

Returns:

URL of the simulation detail page nested under its parameterized model.

Return type:

str

Raises:

ValueError – If parameterized_model_id is not supplied and the fetched simulation has no parameterized_model_id (e.g. a study-only simulation). Pass parameterized_model_id explicitly in that case.

protocol(protocol_id, project_id=None)[source]#

Build a link to a protocol detail page.

Parameters:
  • protocol_id (str) – The protocol (template) ID.

  • project_id (str | None, optional) – The project ID the protocol belongs to. Defaults to the client’s project_id.

Returns:

URL of the protocol detail page.

Return type:

str

material(material_id, project_id=None)[source]#

Build a link to a material detail page.

Parameters:
  • material_id (str) – The material ID.

  • project_id (str | None, optional) – The project ID the material belongs to. Defaults to the client’s project_id.

Returns:

URL of the material detail page.

Return type:

str

cell_specs(project_id=None)[source]#

Build a link to the cell specifications list page.

Cell specifications have no standalone detail route in the web app; this links to their list page within the project’s data section.

Parameters:

project_id (str | None, optional) – The project ID. Defaults to the client’s project_id.

Returns:

URL of the cell specifications list page.

Return type:

str

cell_instances(spec_id, project_id=None)[source]#

Build a link to the cell instances list page for a specification.

Cell instances have no standalone detail route in the web app; this links to the instances list nested under their cell specification.

Parameters:
  • spec_id (str) – The cell specification ID the instances belong to.

  • project_id (str | None, optional) – The project ID. Defaults to the client’s project_id.

Returns:

URL of the cell instances list page.

Return type:

str

measurement(measurement_id, project_id=None)[source]#

Build a link to a cell measurement detail page.

Parameters:
  • measurement_id (str) – The cell measurement ID.

  • project_id (str | None, optional) – The project ID the measurement belongs to. Defaults to the project_id set on the Ionworks client (resolved from the IONWORKS_PROJECT_ID env var if not passed to the client).

Returns:

URL of the measurement detail page on https://app.ionworks.com.

Return type:

str