---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
Input In [11], in <cell line: 1>()
----> 1 d = f('ua', level=85000)
File ~/.conda/envs/pmp_v2.4.0/lib/python3.10/site-packages/cdms2/cudsinterface.py:34, in cuDataset.__call__(self, id, *args, **kwargs)
32 except (AttributeError, TypeError):
33 raise CDMSError("No such variable, " + id)
---> 34 return v(*args, **kwargs)
File ~/.conda/envs/pmp_v2.4.0/lib/python3.10/site-packages/cdms2/avariable.py:194, in AbstractVariable.__call__(self, *args, **kwargs)
192 s = selectors.Selector(*args, **d)
193 # get the selection
--> 194 return s.unmodified_select(self, raw=raw,
195 squeeze=squeeze,
196 order=order,
197 grid=grid)
File ~/.conda/envs/pmp_v2.4.0/lib/python3.10/site-packages/cdms2/selectors.py:191, in Selector.unmodified_select(self, variable, raw, squeeze, order, grid)
189 if _debug:
190 print('About to call subRegion:', specifications)
--> 191 fetched = result.subRegion(*specifications)
192 axismap = list(range(len(axes)))
193 for c in components:
File ~/.conda/envs/pmp_v2.4.0/lib/python3.10/site-packages/cdms2/avariable.py:969, in AbstractVariable.subRegion(self, *specs, **keys)
962 slicelist = self.reg_specs2slices(speclist, force=circulardim)
964 d = {'raw': raw,
965 'squeeze': squeeze,
966 'order': order,
967 'grid': grid,
968 }
--> 969 return self.subSlice(*slicelist, **d)
971 #
972 # get the general wrap slice (indices that are neg -> pos and vica versa)
973 #
975 wrapslice = slicelist[wrapdim]
File ~/.conda/envs/pmp_v2.4.0/lib/python3.10/site-packages/cdms2/avariable.py:732, in AbstractVariable.subSlice(self, *specs, **keys)
730 singles = None
731 slicelist = self.specs2slices(speclist, force=1)
--> 732 d = self.expertSlice(slicelist)
733 squeeze = keys.get('squeeze', 0)
734 raw = keys.get('raw', 0)
File ~/.conda/envs/pmp_v2.4.0/lib/python3.10/site-packages/cdms2/variable.py:686, in DatasetVariable.expertSlice(self, initslist)
683 # If slices with negative strides were input, apply the appropriate
684 # reversals.
685 if haveReversals:
--> 686 result = result[revlist]
688 return result
File ~/.conda/envs/pmp_v2.4.0/lib/python3.10/site-packages/numpy/ma/core.py:3222, in MaskedArray.__getitem__(self, indx)
3212 """
3213 x.__getitem__(y) <==> x[y]
3214
3215 Return the item described by i, as a masked array.
3216
3217 """
3218 # We could directly use ndarray.__getitem__ on self.
3219 # But then we would have to modify __array_finalize__ to prevent the
3220 # mask of being reshaped if it hasn't been set up properly yet
3221 # So it's easier to stick to the current version
-> 3222 dout = self.data[indx]
3223 _mask = self._mask
3225 def _is_scalar(m):
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
(pmp_v2.4.0) [lee1043@gates test]$ conda list cdms2
# packages in environment at /home/lee1043/.conda/envs/pmp_v2.4.0:
#
# Name Version Build Channel
cdms2 3.1.5 py310h65abc81_14 conda-forge
Describe the bug
Leaving this note for a record for those who may experience the similar problem. When opening a 3-dimensional variable that has plev as one of coordinates (such as ua, va, ta), it used to be possible to load the variable from one specific level (e.g., ua on 850 hPa). However, it looks like this capability has been broken, I think.
To Reproduce
Expected behavior
Load variable at 850 hPa
Screenshots or traceback
** Workaround **
Desktop (please complete the following information):
Environment Information
`conda info``conda config --show-sources``conda list --show-channel-urls`Additional context
Add any other context about the problem here.