crunchflow.input.databases.thermo.database.ThermoDatabase ========================================================= .. py:class:: crunchflow.input.databases.thermo.database.ThermoDatabase In-memory representation of a CrunchFlow-style thermodynamic database. This single file contains both the data container and the lightweight parser/writer methods (mirroring the pattern used by input/inputfile.py). .. !! processed by numpydoc !! .. py:method:: from_file(path: str) -> ThermoDatabase :classmethod: Read a database from a file and return the populated instance. .. !! processed by numpydoc !! .. py:method:: read(path: str) -> None Populate this instance from a thermodynamic database file. Overwrites any existing contents. Notes on expected structure (typical CrunchFlow database): - Temperature line (e.g., "temperature points: 0 25 60 ...") - Debye–Hückel arrays (adh, bdh, bdt) on the same grid - Sections terminated by keywords: End of primary End of secondary End of gases End of minerals Surface complexes bracketed by: Begin surface complexation End of surface complexation .. !! processed by numpydoc !! .. py:method:: write(path: str) -> None Write the current database to a file in a straightforward, readable format. This prioritizes clarity and round-trippability for files parsed by this module. .. !! processed by numpydoc !! .. py:method:: clear() -> None Clear all contents, resetting to an empty state. .. !! processed by numpydoc !!