struct

Proxy structures to store parsed compounds, reactions and networks.

class rnets.struct.Compound(name: str, energy: float, idx: int, visible: Visibility = Visibility.TRUE, fflags: set[FFlags] | None = None, conc: float | None = None, opts: dict[str, str] | None = None)[source]

Struct for a chemical compound.

name

Compound name.

Type:

str

energy

Compound energy.

Type:

float

idx

Compound index, in reading order.

Type:

int

visible (obj

Visible, optional): Wether the compound will be visible, grey or not visible. Defaults to Visible.TRUE.

fflags

Format labels that will be used to represent the compound label. Defaults to None.

Type:

set of FFlags or None, optional

conc

Concentration of the given compound. Defaults to None.

Type:

float or None, optional

opts

Additional options for the compound. Will be later used by the writer to decide additional options. Defaults to None.

Type:

dict of str as keys and str as values or None, optional

class rnets.struct.FFlags(value, names=_not_given, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Format flags. They are used to decide the format of the name.

i -> italics b -> bold u -> underscore

class rnets.struct.Network(compounds: Sequence[Compound], reactions: Sequence[Reaction])[source]

Representation of a reaction network.

compounds

Compounds of the network.

Type:

sequence of Compound

reactions

Reactions in the network.

Type:

sequence of Reaction

class rnets.struct.Reaction(name: str, compounds: tuple[tuple[Compound, ...], tuple[Compound, ...]], energy: float, idx: int, opts: dict[str, str] | None = None, visible: Visibility = Visibility.TRUE)[source]

Unidirectional chemical reaction.

name

Reaction name.

Type:

str

compounds

Compounds of the reaction, with left->right direction..

Type:

tuple of the form ([Compound], [Compound])

energy

Energy of the reaction.

Type:

float

idx

Reaction index, in reading order.

Type:

int

opts

Additional options for the compound. Will be later used by the writer to decide additional options. Defaults to None.

Type:

dict of str as keys and str as values or None, optional

visible (obj

Visible, optional): Wether the compound will be visible, grey or not visible. Defaults to Visible.TRUE.

class rnets.struct.Visibility(value, names=_not_given, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Visibility of the element.

FALSE -> Not visible. TRUE -> Visible. GREY -> Greyscale.