All PRs are currently failing their python 3.10 + devdeps tests because the interaction between Quantity.__class_getitem__ and ndarray.__class_getitem__ is not correct. E.g.,
In [2]: u.Quantity[u.m]
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-f0c088963c1a> in <module>
----> 1 u.Quantity[u.m]
~/data/mhvk/packages/astropy/astropy/units/quantity.py in __class_getitem__(cls, unit_shape_dtype)
404 # metadata using Annotated.
405 if not NUMPY_LT_1_22:
--> 406 cls = super().__class_getitem__((cls, *shape_dtype))
407 return Annotated.__class_getitem__((cls, unit))
408
TypeError: Too few arguments for Quantity
It seems that ndarray.__class_getitem__ cannot be called without an actual (shape, dtype). Those also should be meaningful, meaning that the current test u.Quantity[u.m, "more"] would seem to incorrectly associate this "more" with the ndarray aspect.
In [13]: u.Quantity[u.m, "more"]
Out[13]: typing.Annotated[astropy.units.quantity.Quantity[astropy.units.quantity.Quantity, 'more'], Unit("m")]
My sense is to remove the super() call... @nstarman??
All PRs are currently failing their python 3.10 + devdeps tests because the interaction between
Quantity.__class_getitem__andndarray.__class_getitem__is not correct. E.g.,It seems that
ndarray.__class_getitem__cannot be called without an actual(shape, dtype). Those also should be meaningful, meaning that the current testu.Quantity[u.m, "more"]would seem to incorrectly associate this "more" with thendarrayaspect.My sense is to remove the
super()call... @nstarman??