vibesketch.document.stoichiometry

The stoichiometry table of a drawn reaction, as in a lab notebook (#99).

The chemist enters, per participant, an amount (mmol, a mass, or a volume with a density or a concentration) or equivalents; the document stores what was entered (Amount) and nothing is inferred from the drawing. From it this module works out, with the molar masses of the species report:

  • n = m / M, n = V·ρ / M, or n = V·c, in mmol (mg, mL, g/mL, mol/L);

  • the reference: the first reactant with an entered amount, and every participant’s equivalents n / n(reference); equivalents entered alone give n = equivalents · n(reference);

  • the limiting reactant, the smallest n / coefficient among the reactants (reagents above or below the arrow are not consumed);

  • each product’s theoretical amount, n(limiting) / coefficient · its own coefficient, and with an entered amount its isolated yield.

Units are in the column names; CSV keeps full precision and Markdown and LaTeX show three significant figures.

Functions

stoichiometry(document, reaction)

The worked-out table of reaction: one row per participant, reactants first.

stoichiometry_table(document, reaction[, format])

The table as CSV (full precision), Markdown or a booktabs LaTeX fragment.

with_amounts(document, reaction, amounts)

document with reaction's entered amounts replaced; an empty list clears them.

Exceptions

StoichiometryRefused

Amounts that cannot be entered, or a table that cannot be worked out.

exception vibesketch.document.stoichiometry.StoichiometryRefused[source]

Bases: ValueError

Amounts that cannot be entered, or a table that cannot be worked out.

vibesketch.document.stoichiometry.stoichiometry(document, reaction)[source]

The worked-out table of reaction: one row per participant, reactants first.

Parameters:
Return type:

dict[str, Any]

vibesketch.document.stoichiometry.stoichiometry_table(document, reaction, format='csv')[source]

The table as CSV (full precision), Markdown or a booktabs LaTeX fragment.

Parameters:
Return type:

bytes

vibesketch.document.stoichiometry.with_amounts(document, reaction, amounts)[source]

document with reaction’s entered amounts replaced; an empty list clears them.

Parameters:
Return type:

Document