Reactions and Species

mechanica.Species

alias of MxSpecies

class mechanica.MxSpecies(*args)

The Mechanica species object.

Mostly, this is a wrap of libSBML Species.

__str__() 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: str
property name: str
property species_type: str
property compartment: str
property initial_amount: float
property initial_concentration: float
property substance_units: str
property spatial_size_units: str
property units: str
property has_only_substance_units: bool
property boundary_condition: bool
property charge: int
property constant: bool
property conversion_factor: str
mechanica.SpeciesValue

alias of 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 MxSpeciesList

class mechanica.MxSpeciesList
__str__() str

Return str(self).

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

Implement setattr(self, name, value).

__getitem__(item) 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 MxStateVector

class mechanica.MxStateVector(*args)

A state vector of an object.

__str__() str

Return str(self).

__len__() int
__getattr__(item: str)
__setattr__(item: 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