[Debian-astro-maintainers] Bug#868117: astroquery broken with astropy 2.0
Ole Streicher
olebole at debian.org
Wed Jul 12 07:27:39 UTC 2017
Package: astroquery
Version: 0.3.5+dfsg-2
Severity: serious
Control: block 868113 by -1
Hi,
with the latest version of astropy (2.0), astroquery does not work
anymore. From the CI log <https://ci.debian.net/data/autopkgtest/unstable/amd64/a/astroquery/20170711_234410/log.gz>:
____________________________ test_sdss_spectrum[1] _____________________________
patch_get = <_pytest.monkeypatch.MonkeyPatch object at 0x7f312b24b438>
patch_get_readable_fileobj = <_pytest.monkeypatch.MonkeyPatch object at 0x7f312b24b438>
dr = 1
coords = <SkyCoord (ICRS): (ra, dec) in deg
( 2.02345833, 14.83980556)>
@pytest.mark.parametrize("dr", [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12])
def test_sdss_spectrum(patch_get, patch_get_readable_fileobj, dr,
coords=coords):
xid = sdss.SDSS.query_region(coords, data_release=dr, spectro=True)
url_tester(dr)
> sp = sdss.SDSS.get_spectra(matches=xid, data_release=dr)
/usr/lib/python3/dist-packages/astroquery/sdss/tests/test_sdss.py:175:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/astroquery/sdss/core.py:615: in get_spectra
show_progress=show_progress)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <astroquery.sdss.core.SDSSClass object at 0x7f312cf56ac8>
coordinates = None, radius = <Quantity 2.0 arcsec>
matches = <Table length=1>
ra dec objid ... run2d instrument
float64 float64 ...--------- ------------------- ... ----- ----------
2.02344596303 14.8398237521 1237652943176138868 ... 26 SDSS
plate = None, fiberID = None, mjd = None, timeout = 60
get_query_payload = False, data_release = 1, cache = True, show_progress = True
def get_spectra_async(self, coordinates=None, radius=2. * u.arcsec,
matches=None, plate=None, fiberID=None, mjd=None,
timeout=TIMEOUT, get_query_payload=False,
data_release=12, cache=True, show_progress=True):
[...]
for row in matches:
linkstr = self.SPECTRA_URL_SUFFIX
# _parse_result returns bytes (requiring a decode) for
# - instruments
# - run2d sometimes (#739)
if isinstance(row['run2d'], bytes):
run2d = row['run2d'].decode()
else:
run2d = row['run2d']
link = linkstr.format(
base=conf.sas_baseurl, dr=data_release,
> instrument=row['instrument'].decode().lower(),
run2d=run2d, plate=row['plate'],
fiber=row['fiberID'], mjd=row['mjd'])
E AttributeError: 'str' object has no attribute 'decode'
/usr/lib/python3/dist-packages/astroquery/sdss/core.py:587: AttributeError
Could you have a look please?
Best regards
Ole
More information about the Debian-astro-maintainers
mailing list