pisces.models.core.utils.inspect_model_metadata#
- pisces.models.core.utils.inspect_model_metadata(path: str | Path, registry: Registry | None = None) dict [source]#
Inspect a model file’s metadata without fully loading the model.
This function opens an HDF5 model file, reads the
__model_class__
attribute to determine the associated model class, and uses that class’smetadata_serializer
to parse the file’s.attrs
into a metadata dictionary.- Parameters:
- Returns:
A dictionary of metadata for the model as parsed by its
metadata_serializer
.- Return type:
- Raises:
FileNotFoundError – If the file does not exist or is not a file.
ValueError – If the file is missing the
__model_class__
attribute.LookupError – If the model class name is not found in the registry.
AttributeError – If the resolved class does not define
metadata_serializer
.