astropy: Table cannot read numpy void dtype
Description
Cannot read a Table from a file with a numpy.void
dtype column.
Expected behavior
Roundtripping for all numpy array types.
Actual behavior
A ValueError is raised that void
is not a recognized dtype
Steps to Reproduce
import tempfile
import os
with tempfile.TemporaryDirectory() as tempdir:
tbl = QTable({"a": [u.Quantity((0, 0, 0.6), unit="(eV, eV, eV)")]})
tbl.write(os.path.join(tempdir, "temp.ecsv"))
QTable.read(os.path.join(tempdir, "temp.ecsv"))
ValueError: datatype 'void192' of column 'a' is not in allowed values ('bool', 'int8', 'int16', 'int32', 'int64', 'uint8', 'uint16', 'uint32', 'uint64', 'float16', 'float32', 'float64', 'float128', 'string')
System Details
macOS-10.16-x86_64-i386-64bit Python 3.9.5 (default, May 18 2021, 12:31:01) [Clang 10.0.0 ] Numpy 1.21.4 pyerfa 2.0.0.1 astropy 5.1.dev207+gbfb9252df.d20211130 Scipy 1.7.1 Matplotlib 3.3.4
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 15 (15 by maintainers)
Yes, it should - but need to decide on implementation!
I’m playing around with
ColumnInfo
- I think that can work. An additional benefit is that one gets writing of structured data for FITS, etc., for free.