skypyproject / skypy

SkyPy: A package for modelling the Universe.
BSD 3-Clause "New" or "Revised" License
118 stars 38 forks source link

int is not a valid ecsv datatype #484

Closed rrjbca closed 3 years ago

rrjbca commented 3 years ago

Description In the ECSV table format definition int is not listed as a valid datatype. In the SkyPy file examples/galaxies/sdss_dered_10deg2.ecsv int is currently used as the datatype for some columns. Since astropy 4.3 the datatype field is explicitly chacked against a list of allowed values when reading an ecsv file. This causes our documentation builds to fail.

To Reproduce

  1. install astropy 4.3 (and speclite develop branch; see #482)
  2. git clone https://github.com/skypy/skypy.git
  3. cd skypy/docs
  4. make html
examples/galaxies/plot_photometry.py failed leaving traceback:
Traceback (most recent call last):
  File "examples/galaxies/plot_photometry.py", line 69, in <module>
    sdss_data = Table.read("sdss_dered_10deg2.ecsv", format='ascii.ecsv')
  File "astropy/table/connect.py", line 61, in __call__
    out = registry.read(cls, *args, **kwargs)
  File "astropy/io/registry.py", line 527, in read
    data = reader(*args, **kwargs)
  File "astropy/io/ascii/connect.py", line 18, in io_read
    return read(filename, **kwargs)
  File "astropy/io/ascii/ui.py", line 369, in read
    dat = reader.read(table)
  File "astropy/io/ascii/core.py", line 1338, in read
    self.header.get_cols(self.lines)
  File "astropy/io/ascii/ecsv.py", line 186, in get_cols
    raise ValueError(f'datatype {col.dtype!r} of column {col.name!r} '
ValueError: datatype 'int' of column 'dered_u' is not in allowed values ('bool', 'int8', 'int16', 'int32', 'int64', 'uint8', 'uint16', 'uint32', 'uint64', 'float16', 'float32', 'float64', 'float128', 'string')