Coder Social home page Coder Social logo

Comments (12)

astrofrog avatar astrofrog commented on June 21, 2024

Sorry about this - it is due to recent changes in the astropy master. Things have been in a state of flux with the upcoming 0.2 release, but once 0.2 is released, the core package will be a lot more stable. I'll see if there is a quick fix for this.

from astroquery.

astrofrog avatar astrofrog commented on June 21, 2024

Actually, I just noticed that this is an issue in Astropy itself.

@banados - can you update to the latest Astropy master to see if this fixes this error? You can either install the latest and greatest, or if you prefer installing from tar files, you can install the 0.2b2 beta from:

http://stsdas.stsci.edu/download/packages/index/astropy/index.html

Let us know if this fixes things!

from astroquery.

banados avatar banados commented on June 21, 2024

Hi Tom, so I updated to

In [16]: astropy.__version__
Out[16]: '0.3.dev3115'

(is that the version you meant?)

and now I get a different error:

table1 = vizier.vizquery(query)
ERROR: ValueError: masked should be one of True, False, None [astropy.table.table]
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-22-fddc0f7526fd> in <module>()
----> 1 table1 = vizier.vizquery(query)

/usr/local/lib/python2.7/dist-packages/astroquery/vizier/vizier.pyc in vizquery(query, server)
     88             data = voTreeTable.array
     89             # Add Table to the list
---> 90             tableList += [Table(data, names)]
     91 
     92     # Merge the Table list

/home/eduardo/astropy/astropy/table/table.py in __init__(self, data, masked, names, dtypes, meta, copy)
    760         # Set up a placeholder empty table
    761         self._data = None
--> 762         self._set_masked(masked)
    763         self.columns = TableColumns()
    764         self.meta = OrderedDict() if meta is None else deepcopy(meta)

/home/eduardo/astropy/astropy/table/table.py in _set_masked(self, masked)
   1232                 self._masked = masked
   1233             else:
-> 1234                 raise ValueError("masked should be one of True, False, None")
   1235         if self._masked:
   1236             self._column_class = MaskedColumn

ValueError: masked should be one of True, False, None

from astroquery.

astrofrog avatar astrofrog commented on June 21, 2024

@banados - thanks for trying this! I'll look into it.

from astroquery.

astrofrog avatar astrofrog commented on June 21, 2024

@keflavich - the issue is this: Table(data, names) - you should use the keyword names, i.e. Table(data=data, names=names) because the second argument is now mask. I'm going to be mostly offline in the next couple of days, so feel free to fix it (and make sure this doesn't need to be changd elsewhere).

from astroquery.

keflavich avatar keflavich commented on June 21, 2024

Thanks @astrofrog, I'll try to get this fixed.

from astroquery.

keflavich avatar keflavich commented on June 21, 2024

@astrofrog, @banados - this issue has been fixed in master since 1/10/2013 (commit 387d9ea, pr #43). @banados, can you check that you have the latest git version?

from astroquery.

banados avatar banados commented on June 21, 2024

So now I am sure I have the latest git version:

astropy.__version__
'0.3.dev3119'

When I do git log, the last change was on Date: Sun Feb 3 23:36:40 2013 -0800

Now, I get the same error I was getting at the beginning:

WARNING: W27: None:29:2: W27: COOSYS deprecated in VOTable 1.2 [astropy.io.vo.exceptions]
ERROR: AttributeError: 'module' object has no attribute 'get_data_fileobj' [astropy.io.vo.ucd]
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-6-fddc0f7526fd> in <module>()
----> 1 table1 = vizier.vizquery(query)

/usr/local/lib/python2.7/dist-packages/astroquery/vizier/vizier.pyc in vizquery(query, server)
     75     http.request("POST", "/viz-bin/votable", body=body)
     76     resp = http.getresponse()
---> 77     voTable = parse(cStringIO.StringIO(resp.read()), pedantic=False)
     78 
     79     # Convert VOTABLE into a list of astropy Table.

/usr/local/lib/python2.7/dist-packages/astropy/io/vo/table.pyc in parse(source, columns, invalid, pedantic, chunk_size, table_number, filename, _debug_python_based_parser)
    106         _debug_python_based_parser=_debug_python_based_parser) as iterator:
    107         return tree.VOTableFile(
--> 108             config=config, pos=(1, 1)).parse(iterator, config)
    109 
    110 

/usr/local/lib/python2.7/dist-packages/astropy/io/vo/tree.pyc in parse(self, iterator, config)
   2879             if start:
   2880                 tag_mapping.get(tag, self._add_unknown_tag)(
-> 2881                     iterator, tag, data, config, pos)
   2882             elif tag == 'DESCRIPTION':
   2883                 if self.description is not None:

/usr/local/lib/python2.7/dist-packages/astropy/io/vo/tree.pyc in _add_resource(self, iterator, tag, data, config, pos)
   2810         resource = Resource(config=config, pos=pos, **data)
   2811         self.resources.append(resource)
-> 2812         resource.parse(self, iterator, config)
   2813 
   2814     def _add_coosys(self, iterator, tag, data, config, pos):

/usr/local/lib/python2.7/dist-packages/astropy/io/vo/tree.pyc in parse(self, votable, iterator, config)
   2664             if start:
   2665                 tag_mapping.get(tag, self._add_unknown_tag)(
-> 2666                     iterator, tag, data, config, pos)
   2667             elif tag == 'DESCRIPTION':
   2668                 if self.description is not None:

/usr/local/lib/python2.7/dist-packages/astropy/io/vo/tree.pyc in _add_table(self, iterator, tag, data, config, pos)
   2621         table = Table(self._votable, config=config, pos=pos, **data)
   2622         self.tables.append(table)
-> 2623         table.parse(iterator, config)
   2624 
   2625     def _add_info(self, iterator, tag, data, config, pos):

/usr/local/lib/python2.7/dist-packages/astropy/io/vo/tree.pyc in parse(self, iterator, config)
   2008 
   2009                     tag_mapping.get(tag, self._add_unknown_tag)(
-> 2010                         iterator, tag, data, config, pos)
   2011                 else:
   2012                     if tag == 'DESCRIPTION':

/usr/local/lib/python2.7/dist-packages/astropy/io/vo/tree.pyc in _add_field(self, iterator, tag, data, config, pos)
   1937 
   1938     def _add_field(self, iterator, tag, data, config, pos):
-> 1939         field = Field(self._votable, config=config, pos=pos, **data)
   1940         self.fields.append(field)
   1941         field.parse(iterator, config)

/usr/local/lib/python2.7/dist-packages/astropy/io/vo/tree.pyc in __init__(self, votable, ID, name, datatype, arraysize, ucd, unit, width, precision, utype, ref, type, id, xtype, config, pos, **extra)
    999         self.datatype   = datatype
   1000         self.arraysize  = arraysize
-> 1001         self.ucd        = ucd
   1002         self.unit       = unit
   1003         self.width      = width

/usr/local/lib/python2.7/dist-packages/astropy/io/vo/tree.pyc in ucd(self, ucd)
    319                     W28, W28, ('ucd', self._element_name, '1.2'),
    320                     self._config, self._pos)
--> 321             check_ucd(ucd, self._config, self._pos)
    322         self._ucd = ucd
    323 

/usr/local/lib/python2.7/dist-packages/astropy/io/vo/tree.pyc in check_ucd(ucd, config, pos)
    209                 check_controlled_vocabulary=config.get(
    210                     'version_1_2_or_later', False),
--> 211                 has_colon=config.get('version_1_2_or_later', False))
    212         except ValueError as e:
    213             # This weird construction is for Python 3 compatibility

/usr/local/lib/python2.7/dist-packages/astropy/io/vo/ucd.pyc in parse_ucd(ucd, check_controlled_vocabulary, has_colon)
    101     global _ucd_singleton
    102     if _ucd_singleton is None:
--> 103         _ucd_singleton = UCDWords()
    104 
    105     if has_colon:

/usr/local/lib/python2.7/dist-packages/astropy/io/vo/ucd.pyc in __init__(self)
     27         self._capitalization = {}
     28 
---> 29         with config.get_data_fileobj("data/ucd1p-words.txt") as fd:
     30             for line in fd.readlines():
     31                 type, name, descr = [

AttributeError: 'module' object has no attribute 'get_data_fileobj'

from astroquery.

astrofrog avatar astrofrog commented on June 21, 2024

@banados - there's something strange with your installation - /usr/local/lib/python2.7/dist-packages/astropy/io/vo does not exist in the latest Astropy. Could you try removing /usr/local/lib/python2.7/dist-packages/astropy, then installing Astropy and trying again?

from astroquery.

banados avatar banados commented on June 21, 2024

ok... so it seems that the problem was that I checked that I had the latest git astropy version, but I didn't check the astroquery version.

Even after deleting the directory that @astrofrog suggested and installing astropy again I was getting the same error...

So I uninstalled astroquery, updated it to the last version and the error went away

Then, the astroquery version that crashes is:

astroquery.__version__
 '0.0.dev189'

And the version that works without problems is

astroquery.__version__
'0.0.dev219

Thanks all for your help and sorry for not noticing this before!

from astroquery.

astrofrog avatar astrofrog commented on June 21, 2024

@banados - just to follow up on this - when you removed and reinstalled astropy, did you still get errors containing /usr/local/lib/python2.7/dist-packages/astropy/io/vo? If so, there's still something weird because it should be /usr/local/lib/python2.7/dist-packages/astropy/io/votable. Maybe you should try from a clean clone (there may be residual files in build).

from astroquery.

banados avatar banados commented on June 21, 2024

When I removed and reinstalled astropy after deleting /usr/local/lib/python2.7/dist-packages/astropy/io/vo, I was getting the other error associated with the table:

ERROR: ValueError: masked should be one of True, False, None [astropy.table.table]

Actually I started from a clean one, I removed everything related with astropy and astroquery and installed them from scratch. And I confirm now that I have the correct directory instead:

/usr/local/lib/python2.7/dist-packages/astropy/io/votable/

from astroquery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.