amici.ode_export.ODEExporter¶
-
class
amici.ode_export.
ODEExporter
(ode_model, outdir=None, verbose=False, assume_pow_positivity=False, compiler=None, allow_reinit_fixpar_initcond=True, generate_sensitivity_code=True, model_name='model')[source]¶ The ODEExporter class generates AMICI C++ files for ODE model as defined in symbolic expressions.
- Variables
model – ODE definition
verbose – more verbose output if True
assume_pow_positivity –
if set to true, a special pow function is used to avoid problems with state variables that may become negative due to numerical errors
compiler: distutils/setuptools compiler selection to build the python extension
functions – carries C++ function signatures and other specifications
model_name – name of the model that will be used for compilation
model_path – path to the generated model specific files
model_swig_path – path to the generated swig files
allow_reinit_fixpar_initcond – indicates whether reinitialization of initial states depending on fixedParameters is allowed for this model
_build_hints – If the given model uses special functions, this set contains hints for model building.
generate_sensitivity_code – Specifies whether code for sensitivity computation is to be generated
-
__init__
(ode_model, outdir=None, verbose=False, assume_pow_positivity=False, compiler=None, allow_reinit_fixpar_initcond=True, generate_sensitivity_code=True, model_name='model')[source] Generate AMICI C++ files for the ODE provided to the constructor.
- Parameters
ode_model (
amici.ode_export.ODEModel
) – ODE definitionoutdir (
typing.Optional
[str
]) – seeamici.ode_export.ODEExporter.set_paths()
verbose (
typing.Union
[bool
,int
,None
]) – verbosity level for logging, True/False default to logging.Error/logging.DEBUGassume_pow_positivity (
typing.Optional
[bool
]) – if set to true, a special pow function is used to avoid problems with state variables that may become negative due to numerical errorscompiler (
typing.Optional
[str
]) – distutils/setuptools compiler selection to build the python extensionallow_reinit_fixpar_initcond (
typing.Optional
[bool
]) – seeamici.ode_export.ODEExporter
- :param generate_sensitivity_code specifies whether code required for
sensitivity computation will be generated
- Parameters
model_name (
typing.Optional
[str
]) – name of the model to be used during code generation
Methods Summary
__init__
(ode_model[, outdir, verbose, …])Generate AMICI C++ files for the ODE provided to the constructor.
Compiles the generated code it into a simulatable module
Generates the native C++ code for the loaded model and a Matlab script that can be run to compile a mex file from the C++ code
set_name
(model_name)Sets the model name
set_paths
([output_dir])Set output paths for the model and create if necessary
Methods
-
__init__
(ode_model, outdir=None, verbose=False, assume_pow_positivity=False, compiler=None, allow_reinit_fixpar_initcond=True, generate_sensitivity_code=True, model_name='model')[source]¶ Generate AMICI C++ files for the ODE provided to the constructor.
- Parameters
ode_model (
amici.ode_export.ODEModel
) – ODE definitionoutdir (
typing.Optional
[str
]) – seeamici.ode_export.ODEExporter.set_paths()
verbose (
typing.Union
[bool
,int
,None
]) – verbosity level for logging, True/False default to logging.Error/logging.DEBUGassume_pow_positivity (
typing.Optional
[bool
]) – if set to true, a special pow function is used to avoid problems with state variables that may become negative due to numerical errorscompiler (
typing.Optional
[str
]) – distutils/setuptools compiler selection to build the python extensionallow_reinit_fixpar_initcond (
typing.Optional
[bool
]) – seeamici.ode_export.ODEExporter
- :param generate_sensitivity_code specifies whether code required for
sensitivity computation will be generated
- Parameters
model_name (
typing.Optional
[str
]) – name of the model to be used during code generation
-
generate_model_code
()[source]¶ Generates the native C++ code for the loaded model and a Matlab script that can be run to compile a mex file from the C++ code
- Return type
-
set_paths
(output_dir=None)[source]¶ Set output paths for the model and create if necessary
- Parameters
output_dir (
typing.Optional
[str
]) – relative or absolute path where the generated model code is to be placed. IfNone
, this will default to amici-{self.model_name} in the current working directory. will be created if does not exists.- Return type