pisces.models.core.utils.inspect_model_grid#

pisces.models.core.utils.inspect_model_grid(path: str | Path, registry: Registry | None = None)[source]#

Load the grid from a model file without fully instantiating the model.

This function opens the model’s HDF5 file, navigates to the /GRID group, and uses load_grid() to create and return the grid object directly.

Parameters:
  • path (str or Path) – Path to the HDF5 file containing the model.

  • registry (Registry, optional) – Registry mapping grid class names to their corresponding classes. If None, the default Pisces grid registry will be used.

Returns:

The grid instance loaded from the model file.

Return type:

Grid

Raises:
  • FileNotFoundError – If the file does not exist or is not a file.

  • KeyError – If the file does not contain a /GRID group.