sbmltoodejax.modulegeneration

Contents

sbmltoodejax.modulegeneration#

sbmltoodejax.modulegeneration.GenerateModel(modelData, outputFilePath, RateofSpeciesChangeName: str = 'RateofSpeciesChange', AssignmentRuleName: str = 'AssignmentRule', ModelStepName: str = 'ModelStep', ModelRolloutName: str = 'ModelRollout', vary_constant_reactants: bool = False, deltaT: float = 0.1, atol: float = 1e-06, rtol: float = 1e-12, mxstep: int = 5000000)[source]#

This function takes model data created by ParseSBMLFile() and generates a python file containing variables and modules that implement the SBML model.

Note

This function is adapted from sbmltoodepy.modulegeneration.GenerateModel function, however the generated python file is written in JAX and follows different conventions for the generated variables and modules, as detailed in 🔍 Structure of the generated python file

Parameters:
  • modelData (sbmltoodepy.dataclasses.ModelData) – An object containing all the model components and values.

  • outputFilePath (str) – The desired file path of the resulting python file.

  • RateofSpeciesChangeName (str, optional) – The name of the RateofSpeciesChange module defined in the resulting python file. Default to ‘RateofSpeciesChange’.

  • AssignmentRuleName (str) – The name of the AssignmentRule module defined in the resulting python file. Default to ‘AssignmentRule’.

  • ModelStepName (str) – The name of the ModelStep module defined in the resulting python file. Default to ‘ModelStep’.

  • ModelRolloutName (str) – The name of the ModelRollout module defined in the resulting python file. Default to’ModelRollout’.

  • deltaT (float) – Time step size (in seconds). Default to 0.1.

  • atol (float) – Absolute local error tolerance for jax.experimental.odeint solver. Default to 1e-6.

  • rtol (float) – Relative local error tolerance for jax.experimental.odeint solver. Default to 1e-12.

  • mxstep (int) – Maximum number of steps to take for each timepoint for jax.experimental.odeint solver. Default to 5000000.