py_compart_model package

Submodules

py_compart_model.main module

class py_compart_model.main.ArithmaticBase[source]

Bases: object

get_equ(obj)[source]

Get string information for object.

Return type

float

get_value(obj)[source]

Get value of object regardless of Compartment or Param.

Return type

float

class py_compart_model.main.Compartment(name, index, value=None)[source]

Bases: py_compart_model.main.ArithmaticBase

set_init(value)[source]

Set a value.

Return type

None

class py_compart_model.main.Model[source]

Bases: object

C(name, value=None)[source]

Set Compartment for Compartment model.

Return type

Compartment

create_function(params, verbose=True)[source]

Create function string with parameters information.

Return type

None

get_args_from_params()[source]

Get arguments from parameters. It is noted that self.params are ordered by index.

get_compartment_inits()[source]

Sort by index of components of compartment model and return its initial values.

solve(t_span, raw=False, **kargs)[source]
Parameters
  • raw (bool) – if True, return results from solve_ivp.

  • kargs – passed to solve_ivp implemented in scipy.

Return type

PyCompartModelResult

class py_compart_model.main.Param(name, value=None)[source]

Bases: py_compart_model.main.ArithmaticBase

set_value(value)[source]

Set a value.

Return type

None

class py_compart_model.main.PyCompartModelResult(model, res)[source]

Bases: object

reverse_res_to_compartments(res)[source]

Reverse results of y returned from Model.solve method into components results.

Note

If the result name is conflicted with default name of the results of solve_ivp, Raise Error.

Return type

OdeResult

summary()[source]
py_compart_model.main.plot_over_time(ode_res, comparts=None, ax=None)[source]

Plot results of a solver against time,

Module contents