amici.numpy
C++ object views
This module provides views on C++ objects for efficient access.
Functions
|
Evaluate a symbolic expression based on the given simulation outputs. |
Classes
|
Interface class for C++ Exp Data objects that avoids possibly costly copies of member data. |
|
Interface class for C++ |
|
Interface class to expose |
|
Factory class to create xarray DataArrays for fields of a SwigPtrView instance. |
- class amici.numpy.ExpDataView(edata)[source]
Interface class for C++ Exp Data objects that avoids possibly costly copies of member data.
NOTE: This currently assumes that the underlying
ExpDatadoes not change after instantiating anExpDataView.- __init__(edata)[source]
Constructor
- Parameters:
edata (
amici.amici.ExpDataPtr|amici.amici.ExpData) – pointer to the ExpData instance
- get(k[, d]) D[k] if k in D, else d. d defaults to None.
- items() a set-like object providing a view on D's items
- keys() a set-like object providing a view on D's keys
- values() an object providing a view on D's values
- class amici.numpy.ReturnDataView(rdata)[source]
Interface class for C++
amici.ReturnDataobjects that avoids possibly costly copies of member data.- __init__(rdata)[source]
Constructor
- Parameters:
rdata (
amici.amici.ReturnDataPtr|amici.amici.ReturnData) – pointer to theReturnDatainstance
- by_id(entity_id, field=None, model=None)[source]
Get the value of a given field for a named entity.
- Parameters:
entity_id (
str) – The ID of the model entity that is to be extracted fromfield(e.g. a state ID).field (
str) – The requested field, e.g. ‘x’ for model states. This is optional if field would be one of{'x', 'y', 'w'}model (
amici.amici.Model) – The model from which this ReturnDataView was generated. This is optional if this ReturnData was generated withsolver.getReturnDataReportingMode() == amici.RDataReporting.full.
- Return type:
numpy.array
- get(k[, d]) D[k] if k in D, else d. d defaults to None.
- items() a set-like object providing a view on D's items
- keys() a set-like object providing a view on D's keys
- values() an object providing a view on D's values
- amici.numpy.evaluate(expr, rdata)[source]
Evaluate a symbolic expression based on the given simulation outputs.
- Parameters:
expr (
str|sympy.core.expr.Expr) – A symbolic expression, e.g. a sympy expression or a string that can be sympified. Can include state variable, expression, and observable IDs, depending on whether the respective data is available in the simulation results. Parameters are not yet supported.rdata (
amici.numpy.ReturnDataView) – The simulation results.
- Return type:
numpy.array- Returns:
The evaluated expression for the simulation output timepoints.