Reactions and Species

mechanica.Species

alias of mechanica.mechanica.MxSpecies

class mechanica.MxSpecies(*args)

The Mechanica species object.

Mostly, this is a wrap of libSBML Species.

__str__() mechanica.mechanica.MxSpecies.str

Return str(self).

toString() std::string

Get a JSON string representation

Return type

string

Returns

std::string

static fromString(str: std::string const &) MxSpecies *

Create from a JSON string representation.

Parameters

str (string) –

Return type

MxSpecies

Returns

MxSpecies*

__reduce__()

Helper for pickle.

property id: mechanica.mechanica.MxSpecies.str
property name: mechanica.mechanica.MxSpecies.str
property species_type: mechanica.mechanica.MxSpecies.str
property compartment: mechanica.mechanica.MxSpecies.str
property initial_amount: float
property initial_concentration: float
property substance_units: mechanica.mechanica.MxSpecies.str
property spatial_size_units: mechanica.mechanica.MxSpecies.str
property units: mechanica.mechanica.MxSpecies.str
property has_only_substance_units: bool
property boundary_condition: bool
property charge: int
property constant: bool
property conversion_factor: mechanica.mechanica.MxSpecies.str
mechanica.SpeciesValue

alias of mechanica.mechanica.MxSpeciesValue

class mechanica.MxSpeciesValue(*args)

A working valued-object of an underlying MxSpecies attached to an object.

property boundary_condition: bool
property initial_amount: float
property initial_concentration: float
property constant: bool
secrete(amount, to=None, distance=None)

Secrete this species into a neighborhood.

Requires either a list of neighboring particles or neighborhood distance.

Parameters
  • amount (float) – Amount to secrete.

  • to (MxParticleList) – Optional list of particles to secrete to.

  • distance (float) – Neighborhood distance.

Returns

Amount actually secreted, accounting for availability and other subtleties.

Return type

float

mechanica.SpeciesList

alias of mechanica.mechanica.MxSpeciesList

class mechanica.MxSpeciesList
__str__() mechanica.mechanica.MxSpeciesList.str

Return str(self).

__len__() int
__getattr__(item: mechanica.mechanica.MxSpeciesList.str)
__setattr__(item: mechanica.mechanica.MxSpeciesList.str, value) None

Implement setattr(self, name, value).

__getitem__(item) mechanica.mechanica.MxSpecies
__setitem__(item, value) None
item(*args) MxSpecies *

Overload 1:

Get a species by index

Parameters

index (int) – index of the species

Return type

MxSpecies

Returns

MxSpecies*


Overload 2:

Get a species by name

Parameters

s (string) – name of species

Return type

MxSpecies

Returns

MxSpecies*

insert(*args) HRESULT

Overload 1:

Insert a species

Return type

int

Returns

HRESULT


Overload 2:

Insert a species by name

Parameters

s (string) – name of the species

Return type

int

Returns

HRESULT

toString() std::string

Get a JSON string representation

Return type

string

Returns

std::string

static fromString(str: std::string const &) MxSpeciesList *

Create from a JSON string representation.

Parameters

str (string) –

Return type

MxSpeciesList

Returns

MxSpeciesList*

__reduce__()

Helper for pickle.

mechanica.StateVector

alias of mechanica.mechanica.MxStateVector

class mechanica.MxStateVector(*args)

A state vector of an object.

__str__() mechanica.mechanica.MxStateVector.str

Return str(self).

__len__() int
__getattr__(item: mechanica.mechanica.MxStateVector.str)
__setattr__(item: mechanica.mechanica.MxStateVector.str, value: float) None

Implement setattr(self, name, value).

__getitem__(item: int)
__setitem__(item: int, value: float) None
toString() std::string

Get a JSON string representation

Return type

string

Returns

std::string

static fromString(str: std::string const &) MxStateVector *

Create from a JSON string representation.

Parameters

str (string) –

Return type

MxStateVector

Returns

MxStateVector*

__reduce__()

Helper for pickle.

species

Species of the state vector