AMICI: High-Performance Sensitivity Analysis for Large Ordinary Differential Equation Models
Description
What's Changed
The AMICI 1.0 release comes with many changes related to making the API more consistent and modular. On the feature side, a highlight is support for the new PEtab 2.0 format for both the JAX and SUNDIALS interface.
With contributions by @BSnelling, @dilpath, @dweindl, @FFroehlich
BREAKING CHANGES
Removed functionality
The following functionality has been removed without replacement:
- The complete MATLAB interface has been removed.
amici.sbml_import.species_to_parametershas been removed.
API changes
- For a more consistent API, all function names are now
snake_caseinstead ofcamelCase. - The package has been reorganized.
- All importers have been moved to
amici.importerssubpackages. For example, all functionality fromamici.sbml_importis now available inamici.importers.sbml. - All simulation-related functionality has been moved to
amici.sim.sundialsfor the SUNDIALS interface, andamici.sim.jaxfor the JAX interface. - A number of functions and modules have been made private (i.e., their name starts with
_or they are excluded from__all__), as they are not intended for public use and may change without deprecation.
- All importers have been moved to
- The naming of free and fixed parameters has been harmonized across the API:
AMICI differentiates between parameters with respect to which a model can compute sensitivities ("free parameters") and parameters with respect to which no sensitivities can be computed ("fixed parameters").
"Free" and "fixed" are to be understood in the context of parameter estimation, where free parameters are optimized,
while fixed parameters remain constant. Free parameters were previously referred to as just "parameters", and
fixed parameters as "fixed parameters", "constant parameters", or "constants". This has now been harmonized to "free" and "fixed" across the API. E.g.,
Model.setParameters()is nowModel.set_free_parameters(). ReturnDataView.posteq_numstepsandReturnDataView.posteq_numstepsnow return a one-dimensional array of shape(num_timepoints,)instead of a two-dimensional array of shape(1, num_timepoints).ReturnDataView.posteq_statusandReturnDataView.preeq_statusnow returnlist[SteadyStateStatus]instead of anndarray[int]of shape(1, 3).- The way the observation model is passed to the different import functions (
sbml2amici,pysb2amici, ...) has changed: The information previously split acrossobservables,sigmas,noise_distributions,event_observables,event_sigmas, andevent_noise_distributionsdicts is now passed as a singleobservation_model: list[MeasurementChannel]argument. assignmentRules2observableshas been renamed toassignment_rules_to_observablesand now returnslist[MeasurementChannel]to be passed to the import functions.AmiVector::getLengthandAmiVectorArray::getLengthhave been renamed tosizeto be more consistent with STL containers.amici.petab.petab_import.import_modelhas been removed. Useamici.importers.petab.v1.import_petab_probleminstead.Model.getSolverhas been renamed toModel.create_solver, emphasizing that a newSolverinstance is created on each call.amici.runAmiciSimulationandamici.runAmiciSimulationshave been renamed toamici.sim.sundials.run_simulationandamici.sim.sundials.run_simulations, respectively.- The following deprecated functionality has been removed:
NonlinearSolverIteration::functionalhas been removed, useNonlinearSolverIteration::fixedpointinstead.- The deprecated argument
log_as_log10toSbmlImporter.sbml2amiciandSbmlImporter.sbml2jaxhas been removed. Just remove this argument, as this never had any effect. - Deprecated imports from
amici.petab.*inamici.petab.simulationshave been removed. Import those functions directly from their respective modules. - The
force_compileargument toimport_petab_problemhas been removed. See thecompile_argument.
- Model output directory keyword arguments have been harmonized:
What was previously
model_output_dir,output_dir,outdiris now consistently calledoutput_diracross the API. - Plotting functions have been moved from
amici.plottingtoamici.sim.sundials.plotting. Themodelargument has been removed.
Features
Support for the PEtab data format v2.0.0 (draft) for the JAX and SUNDIALS interfaces.
See
amici.importers.petab.PetabImporterand examples for JAX and SUNDIALS.For JAX-based models, the interface can be considered stable; for SUNDIALS-based models, the API may still change.
SBML- and PySB-based PEtab problems are currently supported. For PySB-based PEtab problems, only species and
pysb.Expressionare supported as condition table targets (i.e., no parameters yet).PEtab v1 import for SUNDIALS-based models is still available via
amici.importers.petab.v1. Once PEtab v2 import has been stabilized, PEtab v1 import for SUNDIALS-based models will be removed.Many relevant
ReturnDatafields are now available asxarray.DataArrayviaReturnData.xr.{x,y,w,x0,sx,...}.DataArrays include the identifiers and are often more convenient than the plain numpy arrays. This allows for easy subselection and plotting of the results, and conversion to DataFrames.Model.simulate()has been added as a convenience function to run simulations without having to create aSolverobject explicitly. This is a wrapper for bothamici.sim.sundials.run_simulationandamici.sim.sundials.run_simulations, depending on the type of theedataargument. It also supports passing someSolveroptions as keyword arguments. This is intended for interactive use; for better full control and performance, it is still recommended to create aSolverobject and callamici.sim.sundials.{run_simulation,run_simulations}directly.Improved
picklesupport foramici.sim.sundials.{Model,ModelPtr,Solver,ExpData}. Note that AMICI's pickling support is only intended for short-term storage or inter-process communication. Reading pickled objects after updating AMICI or the model code will almost certainly fail.ModelandModelPtrnow support sufficient pickling for use in multiprocessing contexts. This works only if the amici-generated model package exists in the same file system location and does not change until unpickling.Solveris now picklable if amici was built with HDF5 support. This only works on shared file systems, as the solver state is stored in a temporary HDF5 file.ExpDatais now picklable.
The import function
sbml2amici,pysb2amici, andantimony2amicinow return an instance of the generated model class if called withcompile=True(default).The default directory for model import changed, and a base directory can now be specified via the
AMICI_MODELS_ROOTenvironment variable. Seeamici.get_model_dirfor details.IDs and names of model entities are now not only accessible via
amici.sim.sundials.Model, but also viaamici.sim.sundials.ReturnData(ReturnData.{free_parameter_ids,observable_ids,...},ReturnData.free_parameter_names,observable_names,...}).
Fixes
- Fixed a bug that potentially results in incorrect handling of discontinuities their location depends on a state variable that is subject to an event assignment but otherwise constant.
Full Changelog: https://github.com/AMICI-dev/AMICI/compare/v0.34.1...v1.0.0
Notes
Files
AMICI-dev/AMICI-v1.0.0.zip
Files
(4.6 MB)
| Name | Size | Download all |
|---|---|---|
|
md5:0fd1bea7e8303fb4585d1408557b6d36
|
4.6 MB | Preview Download |
Additional details
Related works
- Is supplement to
- Software: https://github.com/AMICI-dev/AMICI/tree/v1.0.0 (URL)
Software
- Repository URL
- https://github.com/AMICI-dev/AMICI