amici

Top-level module.

Functions

import_model_module(module_name, module_path)

Import Python module of an AMICI model.

get_model_root_dir()

Get the default root directory for AMICI models.

get_model_dir([model_id, jax])

Get the default directory for the model with the given ID.

Exceptions

AmiciVersionError

Error thrown if an AMICI model is loaded that is incompatible with the installed AMICI base package

exception amici.AmiciVersionError[source]

Error thrown if an AMICI model is loaded that is incompatible with the installed AMICI base package

amici.get_model_dir(model_id=None, jax=False)[source]

Get the default directory for the model with the given ID.

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

  • jax (bool) – Whether to get the model directory for a JAX model. If True, a suffix _jax is appended to the model_id.

Return type:

pathlib.Path

Returns:

The model directory. This defaults to {root_dir}/{model_id}, where root_dir is determined via get_model_root_dir(). If model_id is None, a temporary directory is created in {base_dir}/{amici_version} and returned.

amici.get_model_root_dir()[source]

Get the default root directory for AMICI models.

Get the default root directory for AMICI models for the current AMICI version.

Return type:

pathlib.Path

Returns:

The model root directory. This defaults to {base_dir}/{amici_version}. If the environment variable AMICI_MODELS_ROOT is set, it is used as base_dir, otherwise amici_models in the current working directory.

amici.import_model_module(module_name, module_path)[source]

Import Python module of an AMICI model.

Parameters:
  • module_name (str) – Name of the python package of the model

  • module_path (pathlib.Path | str) – Absolute or relative path of the package directory

Return type:

types.ModuleType

Returns:

The model module