biosimulators_utils.model_lang.xpp package#
Submodules#
biosimulators_utils.model_lang.xpp.data_model module#
Data model for XPP simulation methods
- Author:
Jonathan Karr <karr@mssm.edu>
- Date:
2021-08-08
- Copyright:
2021, Center for Reproducible Biomedical Modeling
- License:
MIT
biosimulators_utils.model_lang.xpp.utils module#
Utilities for working with XPP models
- Author:
Jonathan Karr <karr@mssm.edu>
- Date:
2021-08-08
- Copyright:
2021, Center for Reproducible Biomedical Modeling
- License:
MIT
- biosimulators_utils.model_lang.xpp.utils.get_parameters_variables_outputs_for_simulation(model_filename, model_language, simulation_type, algorithm_kisao_id=None, set_filename=None, parameter_filename=None, initial_conditions_filename=None, change_level=<class 'biosimulators_utils.sedml.data_model.SedDocument'>, native_ids=False, native_data_types=False, config=None, max_number_of_steps=None)[source]#
Get the possible observables for a simulation of a model
- Parameters:
model_filename (
str
) – path to model file or directory of XPP ODE, set, parameters, and initial conditions filesmodel_language (
str
) – model language (e.g.,urn:sedml:language:xpp
)simulation_type (
types.Type
) – subclass ofSimulation
algorithm_kisao_id (
str
, optional) – KiSAO id of the algorithm for simulating the model (e.g.,KISAO_0000019
for CVODE)set_filename (
str
, optional) – path to XPP set fileparameter_filename (
str
, optional) – path to XPP parameters fileinitial_conditions_filename (
str
, optional) – path to XPP initial conditions filechange_level (
types.Type
, optional) – level at which model changes will be made (SedDocument
orTask
)native_ids (
bool
, optional) – whether to return the raw id and name of each model component rather than the suggested name for the variable of an associated SED-ML data generatornative_data_types (
bool
, optional) – whether to return new_values in their native data typesconfig (
Config
, optional) – whether to fail on missing includesmax_number_of_steps (
int
, optional) – maximum number of steps to record
- Returns:
possible attributes of a model that can be changed and their default values
list
ofSimulation
: simulations of the modellist
ofVariable
: possible observables for a simulation of the modellist
ofPlot
: possible plots of the results of a simulation of the model- Return type:
list
ofModelAttributeChange
biosimulators_utils.model_lang.xpp.validation module#
Methods for validating XPP files
- Author:
Jonathan Karr <karr@mssm.edu>
- Date:
2021-08-06
- Copyright:
2021, Center for Reproducible Biomedical Modeling
- License:
MIT
- biosimulators_utils.model_lang.xpp.validation.get_xpp_input_configuration_from_directory(dirname)[source]#
Get input file configuration from a directory of files
*.ode
: Main model model*.set
: Set file*.par
: Parameters file*.ic
: Initial conditions file
- Parameters:
dirname (
str
) – path to directory of XPP files- Returns:
str
: path to main model filestr
: path to set filestr
: path to parameters filestr
: path to initial conditions filestr
: name of a set to usestr
: name of a set not to use
- Return type:
tuple
- biosimulators_utils.model_lang.xpp.validation.sanitize_model(filename, keep_only_directives=True, exclude_options=None)[source]#
Sanitize an ODE file for interrogation
Join continued statements into individual lines
Remove statements
- Parameters:
filename (
str
) – path to model file or directory with.ode
and possibly set (.set
), parameter (.par
), andd initial conditions (.ic
) fileskeep_only_directives (
bool
, optional) – whether to keep only directives which limit output variablesexclude_options (
list
ofstr
, optional) – list of directives to exclude
- Returns:
path to sanitized model file
- Return type:
str
- biosimulators_utils.model_lang.xpp.validation.validate_model(filename, set_filename=None, parameter_filename=None, initial_conditions_filename=None, name=None, config=None)[source]#
Check that a model is valid
- Parameters:
filename (
str
) – path to model file or directory with.ode
and possibly set (.set
), parameter (.par
), andd initial conditions (.ic
) filesset_filename (
str
, optional) – path to XPP set fileparameter_filename (
str
, optional) – path to XPP parameters fileinitial_conditions_filename (
str
, optional) – path to XPP initial conditions filename (
str
, optional) – name of model for use in error messagesconfig (
Config
, optional) – whether to fail on missing includes
- Returns:
nested
list
ofstr
: nested list of errors (e.g., required ids missing or ids not unique)nested
list
ofstr
: nested list of errors (e.g., required ids missing or ids not unique)dict
: values of parameters of initial conditions of variables
- Return type:
tuple