Skip to content

Instantly share code, notes, and snippets.

@keflavich
Created March 1, 2015 15:51
Show Gist options
  • Select an option

  • Save keflavich/d0bca4e16f4eefcdd357 to your computer and use it in GitHub Desktop.

Select an option

Save keflavich/d0bca4e16f4eefcdd357 to your computer and use it in GitHub Desktop.
Remote failures March 1, 2015
========================================================================== FAILURES ===========================================================================
__________________________________________________________________ TestAlma.test_doc_example __________________________________________________________________
self = <astroquery.alma.tests.test_alma_remote.TestAlma instance at 0x10bb33b48>, temp_dir = '/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T/tmp7Zkexq'
def test_doc_example(self, temp_dir):
alma = Alma()
alma.cache_location = temp_dir
m83_data = alma.query_object('M83')
assert m83_data.colnames == ['Project_code', 'Source_name', 'RA',
'Dec', 'Band', 'Frequency_resolution',
'Integration', 'Release_date',
'Frequency_support',
'Velocity_resolution', 'Pol_products',
'Observation_date', 'PI_name', 'PWV',
'Member_ous_id', 'Asdm_uid',
'Project_title', 'Project_type',
'Scan_intent']
galactic_center = coordinates.SkyCoord(0*u.deg, 0*u.deg,
frame='galactic')
gc_data = alma.query_region(galactic_center, 1*u.deg)
uids = np.unique(m83_data['Asdm_uid'])
assert b'uid://A002/X3b3400/X90f' in uids
link_list = alma.stage_data(uids[0:2])
totalsize = link_list['size'].sum() * u.Unit(link_list['size'].unit)
> assert totalsize.to(u.GB).value > 1
E assert 0.0 > 1
E + where 0.0 = <Quantity 0.0 Gbyte>.value
E + where <Quantity 0.0 Gbyte> = <bound method Quantity.to of <Quantity 0.0 Gbyte>>(Unit("Gbyte"))
E + where <bound method Quantity.to of <Quantity 0.0 Gbyte>> = <Quantity 0.0 Gbyte>.to
E + and Unit("Gbyte") = u.GB
astroquery/alma/tests/test_alma_remote.py:66: AssertionError
----------------------------------------------------------------------- Captured stdout -----------------------------------------------------------------------
INFO: Staging files... [astroquery.alma.core]
.
____________________________________________________________________ TestAlma.test_cycle1 _____________________________________________________________________
self = <astroquery.alma.tests.test_alma_remote.TestAlma instance at 0x10c00b8c0>, temp_dir = '/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T/tmp_d7qjd'
@pytest.mark.bigdata
def test_cycle1(self, temp_dir):
# About 500 MB
alma = Alma()
alma.cache_location = temp_dir
target = 'NGC4945'
project_code = '2012.1.00912.S'
payload = {'project_code-asu':project_code,
'source_name-asu':target,}
result = alma.query(payload=payload)
assert len(result) == 1
uid_url_table = alma.stage_data(result['Asdm_uid'], cache=False)
> assert len(uid_url_table) == 2
E assert 0 == 2
E + where 0 = len(<Table masked=False length=0>\n URL uid size \n Gbyte \nfloat64 float64 float64\n------- ------- -------)
astroquery/alma/tests/test_alma_remote.py:90: AssertionError
----------------------------------------------------------------------- Captured stdout -----------------------------------------------------------------------
INFO: Staging files... [astroquery.alma.core]
.
____________________________________________________________________ TestAlma.test_cycle0 _____________________________________________________________________
self = <astroquery.alma.tests.test_alma_remote.TestAlma instance at 0x10c76b758>, temp_dir = '/var/folders/_r/c4nkvmpn4vx6qc91qygz8h740000gr/T/tmp_xr7lg'
def test_cycle0(self, temp_dir):
# About 20 MB
alma = Alma()
alma.cache_location = temp_dir
target = 'NGC4945'
project_code = '2011.0.00121.S'
payload = {'project_code-asu':project_code,
'source_name-asu':target,}
result = alma.query(payload=payload)
assert len(result) == 1
uid_url_table = alma.stage_data(result['Asdm_uid'], cache=False)
> assert len(uid_url_table) == 2
E assert 0 == 2
E + where 0 = len(<Table masked=False length=0>\n URL uid size \n Gbyte \nfloat64 float64 float64\n------- ------- -------)
astroquery/alma/tests/test_alma_remote.py:111: AssertionError
----------------------------------------------------------------------- Captured stdout -----------------------------------------------------------------------
INFO: Staging files... [astroquery.alma.core]
.
_________________________________________________________________ TestNrao.test_query_region __________________________________________________________________
self = <astroquery.nrao.tests.test_nrao_remote.TestNrao instance at 0x109deb5f0>
def test_query_region(self):
> result = nrao.core.Nrao.query_region(coord.ICRS("04h33m11.1s 05d21m15.5s"))
astroquery/nrao/tests/test_nrao_remote.py:22:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
args = (<SkyCoord (ICRS): (ra, dec) in deg
(68.29625, 5.35430556)>,), kwds = {}
> f = lambda *args, **kwds: self.fn(obj, *args, **kwds)
astroquery/utils/class_or_instance.py:24:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <astroquery.nrao.core.NraoClass object at 0x10b663c90>, args = (<SkyCoord (ICRS): (ra, dec) in deg
(68.29625, 5.35430556)>,), kwargs = {}
verbose = False, response = <Response [200]>
@class_or_instance
def newmethod(self, *args, **kwargs):
if 'verbose' in kwargs:
verbose = kwargs.pop('verbose')
else:
verbose = False
response = getattr(self, async_method_name)(*args, **kwargs)
if kwargs.get('get_query_payload'):
return response
> result = self._parse_result(response, verbose=verbose)
astroquery/utils/process_asyncs.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <astroquery.nrao.core.NraoClass object at 0x10b663c90>, response = <Response [200]>, verbose = False
def _parse_result(self, response, verbose=False):
if not verbose:
commons.suppress_vo_warnings()
# fix to replace non standard datatype 'integer' in returned VOTable
# with 'int' to make it parsable by astropy.io.votable
integer_re = re.compile(r'datatype="integer"')
content = response.text
new_content = integer_re.sub(r'datatype="int"', content)
# these are pretty bad hacks, but also needed...
days_re = re.compile(r'unit="days" datatype="double"')
new_content = days_re.sub(r'unit="days" datatype="char" arraysize="*"', new_content)
degrees_re = re.compile(r'unit="degrees" datatype="double"')
new_content = degrees_re.sub(r'unit="degrees" datatype="char" arraysize="*"', new_content)
try:
tf = six.BytesIO(new_content.encode())
first_table = votable.parse(tf, pedantic=False).get_first_table()
try:
table = first_table.to_table(use_names_over_ids=True)
except TypeError:
warnings.warn("NRAO table parsing: astropy versions prior to 6558975c use "
"the table column IDs instead of names.")
table = first_table.to_table()
return table
except Exception as ex:
self.response = response
self.table_parse_error = ex
> raise TableParseError("Failed to parse NRAO votable result! The raw response can be found "
"in self.response, and the error in self.table_parse_error.")
E TableParseError: Failed to parse NRAO votable result! The raw response can be found in self.response, and the error in self.table_parse_error.
astroquery/nrao/core.py:256: TableParseError
=========================================== 4 failed, 541 passed, 3 skipped, 2 xfailed, 1 xpassed in 668.16 seconds ===========================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment