-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
Upstream Action RequiredWas: Upstream Fix RequiredWas: Upstream Fix Requiredio.votablenumpy-devtable
Description
- Remember to undo TST: Ignore dtype with a subarray field deprecation warning #10863 ! See TST: Undo PR 10863 now fix is upstream in numpy #10966
Description
@astrofrog reported DeprecationWarning: using a dtype with a subarray field is deprecated. warnings using numpy-dev in v4.0.x (example log). Since v4.0.x is installing numpy from master, while master installs from "nightly" (i.e., weekly) wheel, we won't see it until numpy's wheel is updated.
Caused by numpy/numpy#17419
Steps to Reproduce
I think this might trigger the warning:
>>> import numpy as np
>>> from astropy.io.votable import converters, tree
>>> config = {'verify': 'exception'}
>>> field = tree.Field(None, name='c', datatype='floatComplex', arraysize='2x3*', config=config)
>>> c = converters.get_converter(field, config=config)
>>> c._base.format
'(2,)c8'
>>> default = np.array([], dtype=c._base.format) # Warning?E DeprecationWarning: using a dtype with a subarray field is deprecated.
This can lead to inconsistent behaviour due to the resulting dtype being different from the input dtype.
You may try to use `dtype=dtype.base`, which should give the same result for most inputs,
but does not guarantee the output dimensions to match the subarray ones. (Deprecated NumPy 1.20)
In this case, c._base.format is a string, so I am not sure what dtype.base means in this context. @mhvk , any advise?
Metadata
Metadata
Assignees
Labels
Upstream Action RequiredWas: Upstream Fix RequiredWas: Upstream Fix Requiredio.votablenumpy-devtable