sbmlsim.simulation.timecourse

Definition of timecourses and timecourse simulations.

Module Contents

Classes

Timecourse

Simulation definition.

TimecourseSim

Timecourse simulation consisting of multiple concatenated timecourses.

Attributes

logger

sbmlsim.simulation.timecourse.logger[source]
class sbmlsim.simulation.timecourse.Timecourse(start, end, steps, changes=None, model_changes=None, model_manipulations=None, discard=False)[source]

Bases: sbmlsim.serialization.ObjectJSONEncoder

Simulation definition.

Definition of all information necessary to run a single timecourse simulation.

A single simulation consists of multiple changes which are applied, all simulations are performed and collected.

Changesets and selections are deep copied for persistence.

Parameters
  • start (float) –

  • end (float) –

  • steps (int) –

  • changes (Dict[str, pint.Quantity]) –

  • model_changes (Dict[str, pint.Quantity]) –

  • model_manipulations (dict) –

  • discard (bool) –

__repr__(self)[source]

Get string representation.

Return type

str

to_dict(self)[source]

Convert to dictionary.

Return type

Dict[str, Any]

add_change(self, sid, value)[source]

Add change.

Parameters
  • sid (str) –

  • value (float) –

Return type

None

remove_change(self, sid)[source]

Remove change for given id.

Parameters

sid (str) –

Return type

None

add_model_change(self, sid, change)[source]

Add model change.

Parameters

sid (str) –

Return type

None

add_model_changes(self, model_changes)[source]

Add model changes.

Parameters

model_changes (Dict[str, str]) –

Return type

None

remove_model_change(self, sid)[source]

Remove model change for id.

Parameters

sid (str) –

Return type

None

normalize(self, uinfo)[source]

Normalize values to model units for all changes.

Parameters

uinfo (sbmlsim.units.UnitsInformation) –

Return type

None

strip_units(self)[source]

Strip units from changes for parallel simulation.

All changes must be normalized before stripping !.

Return type

None

class sbmlsim.simulation.timecourse.TimecourseSim(timecourses, selections=None, reset=True, time_offset=0.0)[source]

Bases: sbmlsim.simulation.AbstractSim

Timecourse simulation consisting of multiple concatenated timecourses.

In case of a single timecourse, only the single timecourse is executed.

Parameters
  • timecourses (Union[Timecourse, List[Timecourse]]) –

  • selections (Optional[List[str]]) –

  • reset (bool) –

  • time_offset (float) –

__repr__(self)[source]

Get representation.

Return type

str

_time(self)[source]

Calculate the time vector complete simulation.

Return type

numpy.ndarray

dimensions(self)[source]

Get dimensions.

Return type

List[sbmlsim.simulation.Dimension]

add_model_changes(self, model_changes)[source]

Add model changes to given simulation.

Parameters

model_changes (Dict) –

Return type

None

normalize(self, uinfo)[source]

Normalize timecourse simulation.

Parameters

uinfo (sbmlsim.units.UnitsInformation) –

Return type

None

strip_units(self)[source]

Strip units from simulation.

Return type

None

to_dict(self)[source]

Convert to dictionary.

Return type

Dict[str, Any]

to_json(self, path=None)[source]

Convert definition to JSON.

Parameters

path (pathlib.Path) –

Return type

str

static from_json(json_info)[source]

Load from JSON.

Parameters

json_info (Union[str, pathlib.Path]) –

Return type

TimecourseSim

__str__(self)[source]

Get string representation.

Return type

str