Skip to content

Reaction

stochastix.reaction.Reaction #

Reaction(
    reaction_string: str,
    kinetics: AbstractKinetics,
    name: str | None = None,
)

An equinox.Module representing a single reaction channel.

This class encapsulates a single, unidirectional chemical reaction. It parses a reaction string to identify reactants and products, and associates the reaction with a given kinetic law.

Attributes:

  • kinetics

    The AbstractKinetics object governing the reaction rate.

  • reaction_string

    The string representation of the reaction.

  • name

    The optional name of the reaction.

  • reactants_and_coeffs

    A tuple of (species, coefficient) pairs for the reactants.

  • products_and_coeffs

    A tuple of (species, coefficient) pairs for the products.

  • kinetics_species

    A tuple of species names that the kinetic law depends on, beyond the reactants.

  • reactants

    The reactant species of the reaction.

  • products

    The product species of the reaction.

  • required_species

    All species involved in the reaction.

Parameters:

  • reaction_string (str) –

    The reaction string, e.g., "A + B -> C".

  • kinetics (AbstractKinetics) –

    The kinetic law for the reaction.

  • name (str | None, default: None ) –

    An optional name for the reaction.