amici

AMICI

The AMICI Python module provides functionality for importing SBML or PySB models and turning them into C++ Python extensions.

Module Attributes

amici_path

absolute root path of the amici repository or Python package

amiciSwigPath

absolute path of the amici swig directory

amiciSrcPath

absolute path of the amici source directory

amiciModulePath

absolute root path of the amici module

hdf5_enabled

boolean indicating if amici was compiled with hdf5 support

Functions

get_model_dir([model_id, jax])

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

get_model_root_dir()

Get the default root directory for AMICI models.

import_model_module(module_name, module_path)

Import Python module of an AMICI model

Classes

ModelModule(*args, **kwargs)

Type of AMICI-generated model modules.

add_path(path)

Context manager for temporarily changing PYTHONPATH.

set_path(path)

Context manager for temporarily changing PYTHONPATH.

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

class amici.ModelModule(*args, **kwargs)[source]

Type of AMICI-generated model modules.

To enable static type checking.

__init__(*args, **kwargs)
get_model()[source]

Create a model instance.

Return type:

amici.amici.Model

class amici.add_path(path)[source]

Context manager for temporarily changing PYTHONPATH.

Add a path to the PYTHONPATH for the duration of the context manager.

__init__(path)[source]
amici.amiciModulePath = '/home/docs/checkouts/readthedocs.org/user_builds/amici/checkouts/2974/python/sdist/amici'

absolute root path of the amici module

amici.amiciSrcPath = '/home/docs/checkouts/readthedocs.org/user_builds/amici/checkouts/2974/python/sdist/amici/src'

absolute path of the amici source directory

amici.amiciSwigPath = '/home/docs/checkouts/readthedocs.org/user_builds/amici/checkouts/2974/python/sdist/amici/swig'

absolute path of the amici swig directory

amici.amici_path = '/home/docs/checkouts/readthedocs.org/user_builds/amici/checkouts/2974/python/sdist/amici'

absolute root path of the amici repository or Python 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._local.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._local.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.hdf5_enabled: bool = False

boolean indicating if amici was compiled with hdf5 support

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._local.Path | str) – Absolute or relative path of the package directory

Return type:

amici.ModelModule

Returns:

The model module

class amici.set_path(path)[source]

Context manager for temporarily changing PYTHONPATH.

Set the PYTHONPATH to a given path for the duration of the context manager.

__init__(path)[source]