Skip to content

Commit

Permalink
use handle features method in extract error
Browse files Browse the repository at this point in the history
  • Loading branch information
grantbuster committed Dec 13, 2023
1 parent 3ba3d14 commit 90e44b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sup3r/preprocessing/data_handling/h5_data_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ def extract_feature(cls,
try:
fdata = handle[(feature, time_slice, *(raster_index.flatten(),))]
except ValueError as e:
hfeatures = cls.get_handle_features(file_paths)
msg = (f'Requested feature "{feature}" cannot be extracted from '
f'source data that has available variables: '
f'{handle.dsets}.')
f'source data that has handle features: {hfeatures}.')
logger.exception(msg)
raise ValueError(msg) from e

Expand Down
4 changes: 2 additions & 2 deletions sup3r/preprocessing/data_handling/nc_data_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,9 @@ def extract_feature(cls,
time_slice)

else:
available = [str(var) for var in handle.variables]
hfeatures = cls.get_handle_features(file_paths)
msg = (f'Requested feature "{feature}" cannot be extracted from '
f'source data that has available variables: {available}.')
f'source data that has handle features: {hfeatures}.')
logger.exception(msg)
raise ValueError(msg)

Expand Down

0 comments on commit 90e44b6

Please sign in to comment.