Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example 5 notebook broken with Python 3 #17

Closed
cdeil opened this issue Jun 14, 2018 · 3 comments
Closed

Example 5 notebook broken with Python 3 #17

cdeil opened this issue Jun 14, 2018 · 3 comments

Comments

@cdeil
Copy link
Contributor

cdeil commented Jun 14, 2018

For https://github.com/cds-astro/mocpy/blob/master/notebooks/MOCPy_example5.ipynb with Python 3 I and this cell

#table = moc.query_simbad(10000)
table = moc.query_vizier_table('I/239/hip_main', max_rows=100000)
print(table)

I get this error:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-4-ded2ceed93ca> in <module>()
      1 #table = moc.query_simbad(10000)
----> 2 table = moc.query_vizier_table('I/239/hip_main', max_rows=100000)
      3 print(table)

~/software/anaconda3/envs/hgps-hips/lib/python3.6/site-packages/mocpy/moc.py in query_vizier_table(self, table_id, max_rows)
    377         """
    378 
--> 379         return self._query(table_id, max_rows)
    380 
    381     def _query(self, resource_id, max_rows):

~/software/anaconda3/envs/hgps-hips/lib/python3.6/site-packages/mocpy/moc.py in _query(self, resource_id, max_rows)
    408 
    409         from astropy.io.votable import parse_single_table
--> 410         table = parse_single_table(tmp_vot).to_table()
    411 
    412         # finally delete temp files

~/software/anaconda3/envs/hgps-hips/lib/python3.6/site-packages/astropy/io/votable/table.py in parse_single_table(source, **kwargs)
    153         kwargs['table_number'] = 0
    154 
--> 155     votable = parse(source, **kwargs)
    156 
    157     return votable.get_first_table()

~/software/anaconda3/envs/hgps-hips/lib/python3.6/site-packages/astropy/io/votable/table.py in parse(source, columns, invalid, pedantic, chunk_size, table_number, table_id, filename, unit_format, datatype_mapping, _debug_python_based_parser)
    135             _debug_python_based_parser=_debug_python_based_parser) as iterator:
    136         return tree.VOTableFile(
--> 137             config=config, pos=(1, 1)).parse(iterator, config)
    138 
    139 

~/software/anaconda3/envs/hgps-hips/lib/python3.6/site-packages/astropy/io/votable/tree.py in parse(self, iterator, config)
   3339         config['_current_table_number'] = 0
   3340 
-> 3341         for start, tag, data, pos in iterator:
   3342             if start:
   3343                 if tag == 'xml':

ValueError: 1:0: syntax error

@bmatthieu3 or @tboch - Can you reproduce?

( I didn't try with Python 2, don't know if it works there or not )

@tboch
Copy link
Collaborator

tboch commented Jun 26, 2018

@cdeil : I can reproduce the problem, I think it is related to a service currently not responding at CDS.

@tboch
Copy link
Collaborator

tboch commented Jun 26, 2018

I think it is related to a service currently not responding at CDS.

I was wrong about that one.

Actually, @bmatthieu3 already fixed the problem in 30ba703

@bmatthieu3 : could you upload a new version to pip when you have time? Thanks.

@bmatthieu3
Copy link
Collaborator

Done! it was the prototype of MOC.write which has changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants