sczesla / PyAstronomy

A collection of astronomy-related routines in Python
152 stars 35 forks source link

Votable KeyErrror "Yes" for ExoplanetEU2 #26

Closed jason-neal closed 7 years ago

jason-neal commented 7 years ago

I am trying to run this command from the command line python -c "from PyAstronomy.pyasl import ExoplanetEU2; ExoplanetEU2()" With the purpose of pre-downloading the exoplanetEU data.

But I get a votable error instead...

Traceback (most recent call last):
  File "/home/jneal/anaconda3/envs/py36/lib/python3.6/site-packages/astropy/io/votable/converters.py", line 1195, in parse
    return mapping[value.upper()]
KeyError: 'YES'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/jneal/anaconda3/envs/py36/lib/python3.6/site-packages/PyAstronomy/pyasl/resBased/exoplanetEU.py", line 574, in __init__
    self._readData()
  File "/home/jneal/anaconda3/envs/py36/lib/python3.6/site-packages/PyAstronomy/pyasl/resBased/exoplanetEU.py", line 349, in _readData
    self.vot = votable.parse(self._fs.requestFile(self.dataFileName, 'r', gzip.open))
  File "/home/jneal/anaconda3/envs/py36/lib/python3.6/site-packages/astropy/io/votable/table.py", line 142, in parse
    config=config, pos=(1, 1)).parse(iterator, config)
  File "/home/jneal/anaconda3/envs/py36/lib/python3.6/site-packages/astropy/io/votable/tree.py", line 3405, in parse
    iterator, tag, data, config, pos)
  File "/home/jneal/anaconda3/envs/py36/lib/python3.6/site-packages/astropy/io/votable/tree.py", line 3334, in _add_resource
    resource.parse(self, iterator, config)
  File "/home/jneal/anaconda3/envs/py36/lib/python3.6/site-packages/astropy/io/votable/tree.py", line 3156, in parse
    iterator, tag, data, config, pos)
  File "/home/jneal/anaconda3/envs/py36/lib/python3.6/site-packages/astropy/io/votable/tree.py", line 3113, in _add_table
    table.parse(iterator, config)
  File "/home/jneal/anaconda3/envs/py36/lib/python3.6/site-packages/astropy/io/votable/tree.py", line 2405, in parse
    iterator, colnumbers, fields, config)
  File "/home/jneal/anaconda3/envs/py36/lib/python3.6/site-packages/astropy/io/votable/tree.py", line 2520, in _parse_tabledata
    vo_reraise(e, config, pos)
  File "/home/jneal/anaconda3/envs/py36/lib/python3.6/site-packages/astropy/io/votable/exceptions.py", line 119, in vo_reraise
    raise exc
  File "/home/jneal/anaconda3/envs/py36/lib/python3.6/site-packages/astropy/io/votable/tree.py", line 2517, in _parse_tabledata
    fields[i].ID))
  File "/home/jneal/anaconda3/envs/py36/lib/python3.6/site-packages/astropy/io/votable/exceptions.py", line 119, in vo_reraise
    raise exc
  File "/home/jneal/anaconda3/envs/py36/lib/python3.6/site-packages/astropy/io/votable/tree.py", line 2511, in _parse_tabledata
    data, config, pos)
  File "/home/jneal/anaconda3/envs/py36/lib/python3.6/site-packages/astropy/io/votable/converters.py", line 1197, in parse
    vo_raise(E05, (value,), config, pos)
  File "/home/jneal/anaconda3/envs/py36/lib/python3.6/site-packages/astropy/io/votable/exceptions.py", line 101, in vo_raise
    raise exception_class(args, config, pos)
astropy.io.votable.exceptions.E05: None:634:1190: E05: Invalid boolean value 'Yes'

Any Ideas?

DanielAndreasen commented 7 years ago

I've tried to reproduce this without success. Have you tried deleting the folders inside PyData?

jason-neal commented 7 years ago

Yes I deleted the PyAData/pyasl/reBased data, and it still didn't work even on a couple of different conda environments.

I then created a new environment and it worked on that and now works in all the other environments I tested, even when redeleting the data. Strange...

sczesla commented 7 years ago

Hi,

I remember this problem. As far as I know, it is because ''YES" is not a valid boolean entry, according to the vo standard. The column should be masked after a commit from Jan. 6.

Could you check the PyA version:

p27 -c "import PyAstronomy as pya; print(pya.version)"

The masking should be effective from 0.11.0 on.

Stefan

jason-neal commented 7 years ago

Ah yes, the I reproduce/fix the issue consistently when toggling between 0.10 and 0.11.

Thank you!