You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run the subset with time_components on a cmip6 netcdf file with monthly data and choose a day component which does not exist, like day:01, then you get the following exception:
File "/usr/local/anaconda/envs/rook/lib/python3.7/site-packages/clisops/ops/subset.py", line 244, in subset
return op.process()
File "/usr/local/anaconda/envs/rook/lib/python3.7/site-packages/clisops/ops/base_operation.py", line 107, in process
processed_ds = self._calculate()
File "/usr/local/anaconda/envs/rook/lib/python3.7/site-packages/clisops/ops/subset.py", line 160, in _calculate
result = subset_time_by_components(result, time_components=time_comps)
File "/usr/local/anaconda/envs/rook/lib/python3.7/site-packages/clisops/core/subset.py", line 1641, in subset_time_by_components
{idx for tc in req_t_comp for idx in t_comp_indices[tc]}
File "/usr/local/anaconda/envs/rook/lib/python3.7/site-packages/clisops/core/subset.py", line 1641, in <setcomp>
{idx for tc in req_t_comp for idx in t_comp_indices[tc]}
KeyError: 1
In the example I have chosen monthly data and using a “day” selector which does not exist in the data, like “day:01”. It works with “day:14,15”.
The expected behaviour should probably be to ignore non-existing selectors. This happens already … but if the selector does not appear at all in the data we get an exception. Day 14,15 appears in the data … but no other days.
Description
Run the
subset
withtime_components
on a cmip6 netcdf file with monthly data and choose aday
component which does not exist, likeday:01
, then you get the following exception:What I Did
See this notebook:
https://github.com/roocs/rooki/blob/master/notebooks/tests/test-c3s-cmip6-subset-by-point.ipynb
The text was updated successfully, but these errors were encountered: