From 90e44b6f404b94b455b3a39c5f2076840319570c Mon Sep 17 00:00:00 2001 From: grantbuster Date: Wed, 13 Dec 2023 11:24:45 -0700 Subject: [PATCH] use handle features method in extract error --- sup3r/preprocessing/data_handling/h5_data_handling.py | 4 ++-- sup3r/preprocessing/data_handling/nc_data_handling.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sup3r/preprocessing/data_handling/h5_data_handling.py b/sup3r/preprocessing/data_handling/h5_data_handling.py index f506d4754..8b4e945a2 100644 --- a/sup3r/preprocessing/data_handling/h5_data_handling.py +++ b/sup3r/preprocessing/data_handling/h5_data_handling.py @@ -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 diff --git a/sup3r/preprocessing/data_handling/nc_data_handling.py b/sup3r/preprocessing/data_handling/nc_data_handling.py index f96c03f7f..cc2105b15 100644 --- a/sup3r/preprocessing/data_handling/nc_data_handling.py +++ b/sup3r/preprocessing/data_handling/nc_data_handling.py @@ -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)