amici.amici¶
Core C++ bindings¶
This module encompasses the complete public C++ API of AMICI, which was
exposed via swig. All functions listed here are directly accessible in the
main amici package, i.e., amici.amici.ExpData is available as
amici.ExpData.
Usage of functions and classes from the base amici package is
generally recommended as they often include convenience wrappers that avoid
common pitfalls when accessing C++ types from python and implement some
nonstandard type conversions.
Classes
|
Swig-Generated class templating common python types including |
Generic implementation for a context manager, explicitly deletes copy and move operators for derived classes |
|
|
Swig-Generated class templating common python types including |
|
ExpData carries all information about experimental or condition-specific data |
|
Swig-Generated class that implements smart pointers to ExpData as objects. |
|
Swig-Generated class templating common python types including |
|
An enumeration. |
|
Swig-Generated class templating common python types including |
|
An enumeration. |
|
An enumeration. |
|
An enumeration. |
|
An enumeration. |
|
The Model class represents an AMICI ODE/DAE model. |
|
The ModelContext temporarily stores amici::Model::state and restores it when going out of scope |
|
Swig-Generated class that implements smart pointers to Model as objects. |
|
An enumeration. |
|
An enumeration. |
|
An enumeration. |
|
Swig-Generated class, which, in contrast to other Vector classes, does not allow for simple interoperability with common python types, but must be created using |
|
An enumeration. |
|
Stores all data to be returned by |
|
Swig-Generated class that implements smart pointers to ReturnData as objects. |
|
An enumeration. |
|
An enumeration. |
|
An enumeration. |
|
The Solver class provides a generic interface to CVODES and IDAS solvers, individual realizations are realized in the CVodeSolver and the IDASolver class. |
|
Swig-Generated class that implements smart pointers to Solver as objects. |
|
An enumeration. |
|
An enumeration. |
|
|
|
Swig-Generated class templating |
|
Swig-Generated class templating common python types including |
Functions Summary
|
Returns the current backtrace as std::string |
|
|
|
|
|
Apply parameter scaling according to scaling |
|
Remove parameter scaling according to scaling |
|
|
|
Core integration routine. |
|
Same as runAmiciSimulation, but for multiple ExpData instances. |
|
Apply parameter scaling according to scaling |
|
Remove parameter scaling according to the parameter scaling in pscale |
Functions
-
amici.amici.backtraceString(maxFrames: int) → str[source]¶ Returns the current backtrace as std::string
- Parameters
maxFrames (
int) – Number of frames to include- Return type
string
- Returns
Backtrace
-
amici.amici.getScaledParameter(unscaledParameter: float, scaling: amici.amici.ParameterScaling) → float[source]¶ Apply parameter scaling according to scaling
- Parameters
unscaledParameter (
float) –scaling (
amici.amici.ParameterScaling) – parameter scaling
- Return type
- Returns
Scaled parameter
-
amici.amici.getUnscaledParameter(scaledParameter: float, scaling: amici.amici.ParameterScaling) → float[source]¶ Remove parameter scaling according to scaling
- Parameters
scaledParameter (
float) – scaled parameterscaling (
amici.amici.ParameterScaling) – parameter scaling
- Return type
- Returns
Unscaled parameter
-
amici.amici.parameterScalingFromIntVector(intVec: amici.amici.IntVector) → amici.amici.ParameterScalingVector[source]¶ - Return type
-
amici.amici.runAmiciSimulation(solver: amici.amici.Solver, edata: amici.amici.ExpData, model: amici.amici.Model, rethrow: bool = False) → amici.amici.ReturnData[source]¶ Core integration routine. Initializes the solver and runs the forward and backward problem.
- Parameters
solver (
amici.amici.Solver) – Solver instanceedata (
amici.amici.ExpData) – pointer to experimental data objectmodel (
amici.amici.Model) – model specification objectrethrow (
bool) – rethrow integration exceptions?
- Return type
- Returns
rdata pointer to return data object
-
amici.amici.runAmiciSimulations(solver: amici.amici.Solver, edatas: amici.amici.ExpDataPtrVector, model: amici.amici.Model, failfast: bool, num_threads: int) → Iterable[amici.amici.ReturnData][source]¶ Same as runAmiciSimulation, but for multiple ExpData instances. When compiled with OpenMP support, this function runs multi-threaded.
- Parameters
solver (
amici.amici.Solver) – Solver instanceedatas (
amici.amici.ExpDataPtrVector) – experimental data objectsmodel (
amici.amici.Model) – model specification objectfailfast (
bool) – flag to allow early terminationnum_threads (
int) – number of threads for parallel execution
- Return type
Iterable[ReturnData]
- Returns
vector of pointers to return data objects
-
amici.amici.scaleParameters(bufferUnscaled: Iterable[float], pscale: Iterable[amici.amici.ParameterScaling], bufferScaled: Iterable[float]) → None[source]¶ Apply parameter scaling according to scaling
- Parameters
bufferUnscaled (
typing.Iterable[float]) –pscale (
typing.Iterable[amici.amici.ParameterScaling]) – parameter scalingbufferScaled (
typing.Iterable[float]) – destination
- Return type
-
amici.amici.unscaleParameters(bufferScaled: Iterable[float], pscale: Iterable[amici.amici.ParameterScaling], bufferUnscaled: Iterable[float]) → None[source]¶ Remove parameter scaling according to the parameter scaling in pscale
All vectors must be of same length.
- Parameters
bufferScaled (
typing.Iterable[float]) – scaled parameterspscale (
typing.Iterable[amici.amici.ParameterScaling]) – parameter scalingbufferUnscaled (
typing.Iterable[float]) – unscaled parameters are written to the array
- Return type