From 3c35d1e93cea158ffee7d4146bef4f6495da9f30 Mon Sep 17 00:00:00 2001 From: bnb32 Date: Fri, 10 Mar 2023 07:05:59 -0800 Subject: [PATCH] edge case fix for collection - get_slices --- sup3r/postprocessing/collection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sup3r/postprocessing/collection.py b/sup3r/postprocessing/collection.py index 6b0f369e2..8389791c3 100644 --- a/sup3r/postprocessing/collection.py +++ b/sup3r/postprocessing/collection.py @@ -108,14 +108,14 @@ def get_slices(cls, final_time_index, final_meta, new_time_index, row_loc = np.where(final_time_index.isin(new_time_index))[0] col_loc = np.where(final_meta['gid'].isin(new_meta['gid']))[0] - if not any(row_loc): + if not len(row_loc) > 0: msg = ('Could not find row locations in file collection. ' 'New time index: {} final time index: {}' .format(new_time_index, final_time_index)) logger.error(msg) raise RuntimeError(msg) - if not any(col_loc): + if not len(col_loc) > 0: msg = ('Could not find col locations in file collection. ' 'New index: {} final index: {}' .format(new_index, final_index))