pisces.models.core.utils.inspect_model_fields#
- pisces.models.core.utils.inspect_model_fields(path: str | Path) dict [source]#
Inspect the names and shapes of fields in a model file without fully loading the model.
This function opens an HDF5 model file, navigates to the top-level
FIELDS
group, and extracts the dataset names along with their shapes. It does not load the actual field data into memory.- Parameters:
path (
str
orPath
) – Path to the HDF5 file containing the model.- Returns:
A mapping of field names (strings) to shapes (tuples of ints) for each dataset in the
FIELDS
group.- Return type:
- Raises:
FileNotFoundError – If the file does not exist or is not a file.
KeyError – If the file does not contain a top-level
FIELDS
group.