Skip to content

Commit

Permalink
add check for rioxarray before downloading earthenv data
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwilby authored and tom-andersson committed Mar 21, 2024
1 parent 86b982b commit 7a98619
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions deepsensor/data/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,11 @@ def get_earthenv_auxiliary_data(
cache_dir = None
memory = Memory(cache_dir, verbose=0)

# Check for rioxarray and raise error if not present
import importlib.util
if importlib.util.find_spec("rioxarray") is None:
raise ImportError("The rioxarray is required to run this function, it was not found. Install with `pip install rioxarray`.")

@memory.cache
def _get_auxiliary_data_cached(
var_IDs: str,
Expand Down

0 comments on commit 7a98619

Please sign in to comment.