Skip to content

Commit

Permalink
Suggest installing cfgrib when GRIB is detected and GRIB support is n…
Browse files Browse the repository at this point in the history
…ot available.

Fixes #16
  • Loading branch information
pmav99 committed May 9, 2023
1 parent bfd967e commit 61e25a8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion inspectds/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ def echo_dataset(
# This is why we keep this function
def infer_dataset_type(path: pathlib.Path) -> DATASET_TYPE:
if path.suffix in (".grib", ".grib2"):
dataset_type = DATASET_TYPE.GRIB
if IS_GRIB_AVAILABLE:
dataset_type = DATASET_TYPE.GRIB
else:
msg = "GRIB file detected, but GRIB support is not available. Please install cfgrib."
typer.echo(msg)
raise typer.Exit()
elif path.is_dir() or path.suffix == ".zarr" or path.suffix == ".zip":
dataset_type = DATASET_TYPE.ZARR
else:
Expand Down

0 comments on commit 61e25a8

Please sign in to comment.