chemparseplot.parse.chemgp_hdf5¶
HDF5 Layout¶
grids/<name>: 2D arrays with attrs x_range, y_range, x_length, y_lengthtable/<name>: group of same-length 1D arrayspaths/<name>: point sequences (x, y or rAB, rBC)points/<name>: point sets (x, y or pc1, pc2)Root attrs: metadata scalars
.. versionadded:: 1.7.0 Extracted from chemgp.plt_gp to standalone module.
HDF5 file I/O utilities for ChemGP data.
This module provides functions for reading structured data from ChemGP HDF5 output files. The HDF5 layout mirrors the Julia common_plot.jl helpers.
Module Contents¶
Functions¶
Read a group of same-length vectors as a DataFrame. |
|
Read a 2D grid with optional axis ranges. |
|
Read a path (ordered point sequence). |
|
Read a point set. |
|
Read root-level metadata attributes. |
|
Validate HDF5 file has expected structure. |
API¶
- chemparseplot.parse.chemgp_hdf5.read_h5_table(f: Any, name: str = 'table') Any[source]¶
Read a group of same-length vectors as a DataFrame.
Parameters
f Open HDF5 file object name Name of the table group (default: “table”)
Returns
DataFrame DataFrame with columns from the HDF5 group
- chemparseplot.parse.chemgp_hdf5.read_h5_grid(f: Any, name: str) tuple[numpy.ndarray, numpy.ndarray | None, numpy.ndarray | None][source]¶
Read a 2D grid with optional axis ranges.
Parameters
f Open HDF5 file object name Name of the grid dataset
Returns
tuple (data, x_coords, y_coords) where x_coords and y_coords may be None if axis range attributes are not present
- chemparseplot.parse.chemgp_hdf5.read_h5_path(f: Any, name: str) dict[str, numpy.ndarray][source]¶
Read a path (ordered point sequence).
Parameters
f Open HDF5 file object name Name of the path dataset
Returns
dict Dictionary mapping coordinate names to arrays
- chemparseplot.parse.chemgp_hdf5.read_h5_points(f: Any, name: str) dict[str, numpy.ndarray][source]¶
Read a point set.
Parameters
f Open HDF5 file object name Name of the points dataset
Returns
dict Dictionary mapping coordinate names to arrays
- chemparseplot.parse.chemgp_hdf5.read_h5_metadata(f: Any) dict[str, Any][source]¶
Read root-level metadata attributes.
Parameters
f Open HDF5 file object
Returns
dict Dictionary of metadata attributes
- chemparseplot.parse.chemgp_hdf5.validate_hdf5_structure(f: Any, required_groups: list[str] | None = None) list[str][source]¶
Validate HDF5 file has expected structure.
Parameters
f Open HDF5 file object required_groups List of required group names (default: [“grids”, “table”])
Returns
list[str] List of missing groups (empty if all present)
Raises
ValueError If required groups are missing