Skip to content

Commit

Permalink
improve error message for shapely module not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
anoukvlug committed Mar 29, 2023
1 parent 2ded083 commit aabf739
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion oggm/utils/_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2978,7 +2978,11 @@ def read_pickle(self, filename, use_compression=None, filesuffix=''):
_open = gzip.open if use_comp else open
fp = self.get_filepath(filename, filesuffix=filesuffix)
with _open(fp, 'rb') as f:
out = pickle.load(f)
try:
out = pickle.load(f)
except ModuleNotFoundError as err:
if str(err) == "No module named 'shapely.io'":
raise ModuleNotFoundError("You need shapely to version 2.0 or higher for this to work.")

# Some new attrs to add to old pre-processed directories
if filename == 'model_flowlines':
Expand Down

0 comments on commit aabf739

Please sign in to comment.