roms_tools.Grid.from_yaml

Contents

roms_tools.Grid.from_yaml#

classmethod Grid.from_yaml(filepath: str | Path, verbose: bool = False, **kwargs: Any) Grid#

Create an instance of the class from a YAML file.

Parameters:
  • filepath (Union[str, Path]) – The path to the YAML file from which the parameters will be read.

  • verbose (bool, optional) – Indicates whether to print grid generation steps with timing. Defaults to False.

  • **kwargs (Any) –

    Additional keyword arguments:

    • section_name : str, optional (default: “Grid”) The name of the YAML section containing the grid configuration.

Returns:

Grid – An instance of the Grid class initialized with the parameters from the YAML file.

Raises:

ValueError – If the ROMS-Tools version is not found in the YAML file or if the specified section does not exist in the file.

Warning

Issues a warning if the ROMS-Tools version in the YAML header does not match the currently installed version.