URLs¶
Helpers that build links to pages in the Ionworks web app
(https://app.ionworks.com).
Frontend URL helpers for the Ionworks web app.
UrlsClient methods take a resource ID plus its route’s parent IDs;
project_id defaults to the client’s (IONWORKS_PROJECT_ID). The host follows
the client’s api_url (api.ionworks.com → app.ionworks.com,
stage-api.ionworks.com → stage.ionworks.com). Set IONWORKS_APP_URL
locally, where the frontend’s port cannot be derived from the API’s.
- class ionworks.api.urls.UrlsClient(client: Client)[source]¶
Bases:
objectBuild links to pages in the Ionworks web app from ids, without a request.
A fallback: prefer
client.<resource>.get(id).url, which the server builds from the record. Returned URLs point at the environment the client is configured for, derived from itsapi_url(override withIONWORKS_APP_URL).- project(project_id: str | None = None) str[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 (
/projects/{p}/studies), so this returns that URL.
- model(model_id: str, project_id: str | None = None) str[source]¶
Build a link to a model detail page.
- parameterized_model(parameterized_model_id: str, project_id: str | None = None) str[source]¶
Build a link to a parameterized model detail page.
- optimization(optimization_id: str, project_id: str | None = None) str[source]¶
Build a link to an optimization detail page.
- pipeline(pipeline_id: str, project_id: str | None = None) str[source]¶
Build a link to a pipeline detail page.
- study(study_id: str, project_id: str | None = None) str[source]¶
Build a link to a study detail page.
- simulation(simulation_id: str, parameterized_model_id: str | None = None, project_id: str | None = None) str[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. Whenparameterized_model_idis not supplied, the simulation is fetched and theurlit carries is returned.- 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:
- Raises:
ValueError – If
parameterized_model_idis not supplied and the fetched simulation has noparameterized_model_id(e.g. a study-only simulation). Passparameterized_model_idexplicitly in that case.
- protocol(protocol_id: str, project_id: str | None = None) str[source]¶
Build a link to a protocol detail page.
- material(material_id: str, project_id: str | None = None) str[source]¶
Build a link to a material detail page.
- cell_specs(project_id: str | None = None) str[source]¶
Build a link to the cell specifications list page.
This is the project’s Cells page, which lists its cell specifications.
- cell_instances(spec_id: str, project_id: str | None = None) str[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 their cell specification’s page, which lists them.