Skip to content

Commit

Permalink
Merge pull request #24 from MAIF/feature/warn_when_cfgrib_not_installed
Browse files Browse the repository at this point in the history
ImportError with clear help when cfgrib not installed
  • Loading branch information
GratienDSX authored Jan 21, 2025
2 parents 9536cca + a3f3b88 commit 3344b6a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/meteole/forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import tempfile
from abc import ABC, abstractmethod
from functools import reduce
from importlib.util import find_spec
from typing import Any

import pandas as pd
Expand All @@ -15,6 +16,12 @@
from meteole.clients import BaseClient
from meteole.errors import MissingDataError

if find_spec("cfgrib") is None:
raise ImportError(
"The 'cfgrib' module is required to read Arome and Arpege GRIB files. Please install it using:\n\n"
" conda install -c conda-forge cfgrib\n\n"
)

logger = logging.getLogger(__name__)


Expand Down

0 comments on commit 3344b6a

Please sign in to comment.