exogibbs.io package
Submodules
exogibbs.io.load_data module
- exogibbs.io.load_data.get_data_filepath(filename)
get the full path of the data file
- Parameters:
filename (str) – filename of the test data
dirname (str) – directory name of the test data (default: “data/testdata/”)
- Returns:
full path of the test data file
- Return type:
str
- exogibbs.io.load_data.load_JANAF_molecules(df_molname: DataFrame, path_JANAF_data: str | Path, *, tag: str = '(g)', save_hdf5: str | None = None, hdf5_compression: str = 'zlib') Dict[str, DataFrame]
Load JANAF tables for all molecules listed in
df_molname
and return them as a dict{molecule: DataFrame}
. Each DataFrame keeps its original (row, col) shape, which is convenient for later conversion to JAX arrays.- Parameters:
df_molname – pd.DataFrame Must contain a column named
"Molecule"
with file prefixes.path_JANAF_data – str or Path Directory that holds
<molecule>(g).txt
files.tag – str tag for JANAF file default to “(g)”
save_hdf5 – str, optional If given, the dict is additionally written to an HDF5 file whose key is the molecule name (e.g.
/H2O
). PassingNone
skips on-disk storage.hdf5_compression – {“zlib”, “blosc”, …}, default “zlib” Compression algorithm for the HDF5 table format.
- Returns:
dict[str, pd.DataFrame] Mapping from molecule name to its JANAF table.
Notes
Missing files or read errors are skipped with a warning.
Use
jax.numpy.asarray(df.to_numpy())
when you need a JAX array.
Examples
>>> df_molname = load_molname_ykb4() >>> path_JANAF_data = "/home/kawahara/thermochemical_equilibrium/Equilibrium/JANAF" >>> matrices = load_JANAF_molecules(df_molname, path_JANAF_data) >>> mat = matrices["C1O2"].to_numpy()
- exogibbs.io.load_data.load_JANAF_rawtxt(filename)
loads a JANAF raw text file
- Parameters:
filename (str) – filename of the JANAF raw text file, e.g. ‘H2(g).txt’
- Returns:
DataFrame containing the data from the JANAF raw text file
- Return type:
pd.DataFrame