[Debian-astro-maintainers] Bug#994783: astropy-regions breaks gammapy autopkgtest: KeyError: '.'
Paul Gevers
elbrus at debian.org
Mon Sep 20 21:08:37 BST 2021
Source: astropy-regions, gammapy
Control: found -1 astropy-regions/0.5-1
Control: found -1 gammapy/0.18.2-1
Severity: serious
Tags: sid bookworm
X-Debbugs-CC: debian-ci at lists.debian.org
User: debian-ci at lists.debian.org
Usertags: breaks needs-update
Dear maintainer(s),
With a recent upload of astropy-regions the autopkgtest of gammapy fails
in testing when that autopkgtest is run with the binary packages of
astropy-regions from unstable. It passes when run with only packages
from testing. In tabular form:
pass fail
astropy-regions from testing 0.5-1
gammapy from testing 0.18.2-1
all others from testing from testing
I copied some of the output at the bottom of this report.
Currently this regression is blocking the migration of astropy-regions
to testing [1]. Due to the nature of this issue, I filed this bug report
against both packages. Can you please investigate the situation and
reassign the bug to the right package?
More information about this bug and the reason for filing it can be found on
https://wiki.debian.org/ContinuousIntegration/RegressionEmailInformation
Paul
[1] https://qa.debian.org/excuses.php?package=astropy-regions
https://ci.debian.net/data/autopkgtest/testing/amd64/g/gammapy/15348901/log.gz
=================================== FAILURES
===================================
___________________ test_edispkernel_from_diagonal_response
____________________
def test_edispkernel_from_diagonal_response():
energy_axis_true = MapAxis.from_energy_bounds(
"0.3 TeV", "10 TeV", nbin=11, name="energy_true"
)
energy_axis = MapAxis.from_energy_bounds(
"0.3 TeV", "10 TeV", nbin=11, name="energy"
)
> region = make_region("fk5;circle(0.,0., 10.")
/usr/lib/python3/dist-packages/gammapy/irf/tests/test_edisp_map.py:244:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _
/usr/lib/python3/dist-packages/gammapy/utils/regions.py:83: in make_region
return DS9Parser(region).shapes[0].to_region()
/usr/lib/python3/dist-packages/astropy/utils/decorators.py:124: in
deprecated_func
return func(*args, **kwargs)
/usr/lib/python3/dist-packages/regions/io/ds9/read.py:194: in __init__
self.run()
/usr/lib/python3/dist-packages/regions/io/ds9/read.py:223: in run
self.parse_line(line)
/usr/lib/python3/dist-packages/regions/io/ds9/read.py:268: in parse_line
self.parse_region(include, region_type, region_end, line)
/usr/lib/python3/dist-packages/regions/io/ds9/read.py:333: in parse_region
helper.parse()
/usr/lib/python3/dist-packages/regions/io/ds9/read.py:436: in parse
self.convert_coordinates()
/usr/lib/python3/dist-packages/regions/io/ds9/read.py:482: in
convert_coordinates
coord_list.append(element_parser(element))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _
string_rep = '10.', unit = Unit("deg")
@staticmethod
def parse_angular_length_quantity(string_rep, unit=u.deg):
"""
Parse a string into a Quantity object.
Given a string that is a number and a unit, return a Quantity of
that string, e.g.:
* 23.9 -> 23.9 * u.deg
* 50" -> 50 * u.arcsec
"""
unit_mapping = {'"': u.arcsec,
"'": u.arcmin,
'd': u.deg,
'r': u.rad,
'i': u.dimensionless_unscaled,
'p': u.dimensionless_unscaled}
has_unit = string_rep[-1] not in string.digits
if has_unit:
> unit = unit_mapping[string_rep[-1]]
E KeyError: '.'
/usr/lib/python3/dist-packages/regions/io/ds9/read.py:136: KeyError
___________________________ test_edispkernel_from_1D
___________________________
def test_edispkernel_from_1D():
energy_axis_true = MapAxis.from_energy_bounds(
"0.5 TeV", "5 TeV", nbin=31, name="energy_true"
)
energy_axis = MapAxis.from_energy_bounds(
"0.1 TeV", "10 TeV", nbin=11, name="energy"
)
edisp = EDispKernel.from_gauss(energy_axis_true.edges,
energy_axis.edges, 0.1, 0.0)
> region = make_region("fk5;circle(0.,0., 10.")
/usr/lib/python3/dist-packages/gammapy/irf/tests/test_edisp_map.py:265:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _
/usr/lib/python3/dist-packages/gammapy/utils/regions.py:83: in make_region
return DS9Parser(region).shapes[0].to_region()
/usr/lib/python3/dist-packages/astropy/utils/decorators.py:124: in
deprecated_func
return func(*args, **kwargs)
/usr/lib/python3/dist-packages/regions/io/ds9/read.py:194: in __init__
self.run()
/usr/lib/python3/dist-packages/regions/io/ds9/read.py:223: in run
self.parse_line(line)
/usr/lib/python3/dist-packages/regions/io/ds9/read.py:268: in parse_line
self.parse_region(include, region_type, region_end, line)
/usr/lib/python3/dist-packages/regions/io/ds9/read.py:333: in parse_region
helper.parse()
/usr/lib/python3/dist-packages/regions/io/ds9/read.py:436: in parse
self.convert_coordinates()
/usr/lib/python3/dist-packages/regions/io/ds9/read.py:482: in
convert_coordinates
coord_list.append(element_parser(element))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _
string_rep = '10.', unit = Unit("deg")
@staticmethod
def parse_angular_length_quantity(string_rep, unit=u.deg):
"""
Parse a string into a Quantity object.
Given a string that is a number and a unit, return a Quantity of
that string, e.g.:
* 23.9 -> 23.9 * u.deg
* 50" -> 50 * u.arcsec
"""
unit_mapping = {'"': u.arcsec,
"'": u.arcmin,
'd': u.deg,
'r': u.rad,
'i': u.dimensionless_unscaled,
'p': u.dimensionless_unscaled}
has_unit = string_rep[-1] not in string.digits
if has_unit:
> unit = unit_mapping[string_rep[-1]]
E KeyError: '.'
/usr/lib/python3/dist-packages/regions/io/ds9/read.py:136: KeyError
__________________________________ test_width
__________________________________
region = <CircleSkyRegion(center=<SkyCoord (Galactic): (l, b) in deg
(0., 0.)>, radius=1.0 deg)>
def test_width(region):
geom = RegionGeom.create(region)
> assert_allclose(geom.width.value, [2.02, 2.02])
E AssertionError:
E Not equal to tolerance rtol=1e-07, atol=0
E
E Mismatched elements: 2 / 2 (100%)
E Max absolute difference: 7269.97999963
E Max relative difference: 3598.99999982
E x: array([7272., 7272.])
E y: array([2.02, 2.02])
/usr/lib/python3/dist-packages/gammapy/maps/tests/test_region.py:47:
AssertionError
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/debian-astro-maintainers/attachments/20210920/aced09f3/attachment.sig>
More information about the Debian-astro-maintainers
mailing list