question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

astropy.io.ascii.Cds format exception (ValueError for invalid NULL)

See original GitHub issue

EDIT: Solution provided at https://github.com/astropy/astropy/issues/11239#issuecomment-758778951

Description

The CDS format (astropy.io.ascii.Cds) throws exceptions for some VizieR tables.

The exception appears for ascii tables having ‘-’ as null values.

Expected behavior

Take into account the ‘-’ as null values in the read method.

Actual behavior

Throw an Exception

Steps to Reproduce

# Put your Python code snippet here.
from astropy.io import ascii
readme = "ftp://cdsarc.u-strasbg.fr/pub/cats/J/A+A/642/A176/ReadMe"
r = ascii.get_reader(ascii.Cds, readme=readme)
table = r.read("ftp://cdsarc.u-strasbg.fr/pub/cats/J/A+A/642/A176/table5.dat")

System Details

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:28 (21 by maintainers)

github_iconTop GitHub Comments

1reaction
gilleslandaiscommented, Jan 19, 2021

BTW if the byte-by-byte indicates the column with ?=-, then it should mark those as missing (otherwise would be a bug).

It’s sounds good -

In CDS side we will clarify NULL decimal values- when NULL decimal values are not specified with ‘?=…’ , only blank are accepted. Else decimal NULL values will be declared (example: ?=999 for 999 NULL values or ?=- to use the pattern --* as NULL)

0reactions
github-actions[bot]commented, Sep 7, 2021

I’m going to close this issue as per my previous message, but if you feel that this issue should stay open, then feel free to re-open and remove the Close? label.

If this is the first time I am commenting on this issue, or if you believe I closed this issue incorrectly, please report this here

Read more comments on GitHub >

github_iconTop Results From Across the Web

ASCII Tables (astropy.io.ascii) — Astropy v5.2
astropy.io.ascii provides methods for reading and writing a wide range of ASCII data table formats via built-in Extension Reader Classes.
Read more >
Full Changelog — Astropy v3.2.dev994
[#5578]; Units in CDS-formatted tables are now parsed correctly by the units ... Fix a unicode decode error when reading a table with...
Read more >
astropy.io.fits History
Prior to its inclusion in Astropy, the astropy.io.fits package was a ... the case of malformatted FITS files that contain non-float NULL values...
Read more >
asciitable 0.8.0 documentation
The astropy.io.ascii package is being actively developed and contains many new features and bug ... fixed format table, or a CDS-compatible table, etc....
Read more >
python-astropy-4.0.2-bp153.1.10 - SUSE Package Hub
[gh#astropy/astropy#9812] Fixed exception when changing ``format`` in the case when ... astropy.io.ascii * Removed incorrect warnings on ``Overflow`` when ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found