biocrnpyler.core.WeightedSpecies

class biocrnpyler.core.WeightedSpecies(species: Species, stoichiometry: int = 1)[source]

Bases: object

Container for a species with stoichiometric coefficient.

Wraps a Species object together with its stoichiometry for use in reactions. This class is primarily used internally by the Reaction class to represent reactants and products with their coefficients.

Parameters:
  • species (Species) – The species object.

  • stoichiometry (int, default 1) – The stoichiometric coefficient. Must be a positive integer.

Attributes:
  • species (Species) – The wrapped species object.

  • stoichiometry (int) – The stoichiometric coefficient (positive integer).

See also

Species

Base class for chemical species.

Reaction

Chemical reaction containing weighted species.

Examples

Create a weighted species:

>>> S = bcp.Species('S')
>>> ws = bcp.WeightedSpecies(species=S, stoichiometry=2)
>>> ws.stoichiometry
2

Methods

pretty_print

replace_species

__eq__(other)[source]

Return self==value.