PourPy.reactant =============== .. py:module:: PourPy.reactant .. autoapi-nested-parse:: Created on Sun May 14 10:57:37 2023 @author: anjakorber Classes ------- .. autoapisummary:: PourPy.reactant.Reactant Module Contents --------------- .. py:class:: Reactant(formula, state, dGf, dHf, Sm, elements) Reactant class that defines an ion, compound or electron including all required thermodynamic and molecular parameters. .. py:attribute:: formula .. py:attribute:: state .. py:attribute:: charge :value: 0 .. py:attribute:: atoms :value: 0 .. py:attribute:: MW :value: 0.0 .. py:attribute:: dGf .. py:attribute:: dHf .. py:attribute:: Sm .. py:method:: __str__() .. py:method:: initialize() Initialize additional properties of the Reactant. :return: None :rtype: None .. py:method:: _get_formula(formula) Validate and returns user-input chemical formula of the reactant. :param formula: The chemical formula to validate. :return: Validated chemical formula. .. py:method:: _get_state(state) Validates and returns the user-input physical state of the reactant. :param state: The physical state to validate. :return: Validated physical state. .. py:method:: _get_charge() Validates and returns the user-input charge of the reactant. :return: The charge of the reactant, 0 if not present. .. py:method:: _get_atoms(elements) Retrieves a dictionary of atoms in the reactant. :return: A dictionary containing atom symbols as keys and their counts as values. .. py:method:: _get_molecular_weight(elements) Calculates the molecular weight of the reactant. :return: The molecular weight of the reactant in grams per mole. .. py:method:: _get_super_string(x) Converts numeric characters in the formula of the reactant to Unicode superscript characters. :param x: The input string to convert. :return: The input string with numeric characters replaced by super-script characters. .. py:method:: _get_sub_string(x) Converts numeric characters in the formula of the reactant to Unicode subscript characters. :param x: The input string to convert. :return: The input string with numeric characters replaced by sub-script characters. .. py:method:: _get_reactant_string() Creates a formatted string representing the reactant formula. :return: Formatted string representation of the reactant, including subscripts for number of atoms and superscripts for charge.