Terarium Client

Terarium Client (mira.terarium_client)

Client functionality to Terarium.

associate(*, project_id, model_id)[source]

Associate a model (UUID) to a project (UUID) and return the association UUID

Parameters:
  • project_id (str) – UUID of the project

  • model_id (str) – UUID of the model

Return type:

str

Returns:

UUID of the association

post_template_model(template_model, project_id=None)[source]

Post a template model to Terarium as a Petri Net AMR.

Optionally add to a project(s) if given.

Parameters:
Return type:

TerariumResponse

Returns:

TerariumResponse

post_amr(amr, project_id=None)[source]

Post an AMR to Terarium.

Optionally add to a project(s) if given.

Parameters:
  • amr – AMR to post

  • project_id (Union[str, List[str], None]) – UUID of the project to add model to (optional)

Return type:

TerariumResponse

Returns:

TerariumResponse

post_amr_remote(model_url, *, project_id=None)[source]

Download an AMR from a URL then post to Terarium.

Optionally add to a project(s) if given.

To add the July 2023 evaluation scenario 3 base model to the evaluation project, run the following:

>>> post_amr_remote(
>>>     "https://raw.githubusercontent.com/indralab/mira/hackathon/"
>>>     "notebooks/evaluation_2023.07/eval_scenario3_base.json",
>>>     project_id="37",
>>> )
Parameters:
  • model_url (str) – URL to download AMR from

  • project_id (Union[str, List[str], None]) – UUID of the project to add model to (optional)

Return type:

TerariumResponse

Returns:

TerariumResponse

get_template_model(model_id)[source]

Get a template model from Terarium by its model UUID

Parameters:

model_id (str) – UUID of the model

Return type:

TemplateModel

Returns:

TemplateModel of the model