[Debian-astro-commits] [python-astropy] 01/03: Revert astropy.wcs to 1.1 to workaround test failure

Ole Streicher olebole at moszumanska.debian.org
Thu Jan 14 10:15:04 UTC 2016


This is an automated email from the git hooks/post-receive script.

olebole pushed a commit to branch debian
in repository python-astropy.

commit e5c6c6fc0f29c8f6dbde87dad0a3ba3cf63548d2
Author: Ole Streicher <olebole at debian.org>
Date:   Thu Jan 14 10:16:27 2016 +0100

    Revert astropy.wcs to 1.1 to workaround test failure
---
 debian/changelog                              |  1 +
 debian/patches/downgrade_astropy_wcs_py.patch | 47 +++++++++++++++++++++++++++
 debian/patches/series                         |  1 +
 3 files changed, 49 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index ce40b7c..2ebd075 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ python-astropy (1.1.1-1) unstable; urgency=low
   * New upstream version
   * Depend python-astropy-utils on python-astropy of the same version.
     Closes: #807834
+  * Revert astropy.wcs to 1.1 to workaround test failure
 
  -- Ole Streicher <olebole at debian.org>  Sat, 09 Jan 2016 10:19:00 +0100
 
diff --git a/debian/patches/downgrade_astropy_wcs_py.patch b/debian/patches/downgrade_astropy_wcs_py.patch
new file mode 100644
index 0000000..622ec53
--- /dev/null
+++ b/debian/patches/downgrade_astropy_wcs_py.patch
@@ -0,0 +1,47 @@
+From: Ole Streicher <olebole at debian.org>
+Subject: Reverse "Optimize instantiation of WCS object"
+ This patch reverses patch 6d4552e450129 from Kacper Kowalik (Xarthisius)
+ <xarthisius.kk at gmail.com>:
+ .
+ In WCS._remove_sip_kw() instead of testing existence of
+ 40k keywords, use regular expression to identify SIP ones.
+Bug: https://github.com/astropy/astropy/issues/ 4460
+--- a/astropy/wcs/wcs.py
++++ b/astropy/wcs/wcs.py
+@@ -34,7 +34,6 @@
+ import copy
+ import io
+ import os
+-import re
+ import textwrap
+ import warnings
+ import platform
+@@ -132,11 +131,6 @@
+ # Additional relax bit flags
+ WCSHDO_SIP = 0x10000
+ 
+-# Regular expression defining SIP keyword
+-# It matches keyword that starts with A, B, AP or B, followed by an underscore then
+-# a number in range of 0-19, followed by an underscore and another number
+-# in range of 0-19. Keyword optionally ends with a capital letter.
+-SIP_KW = re.compile('''^(A|B|AP|BP)_(?:[0-9]|1[0-9])_(?:[0-9]|1[0-9])(|[A-Z])$''')
+ 
+ def _parse_keysel(keysel):
+     keysel_flags = 0
+@@ -988,9 +982,13 @@
+         """
+         # Never pass SIP coefficients to wcslib
+         # CTYPE must be passed with -SIP to wcslib
+-        for key in (m.group() for m in map(SIP_KW.match, header.keys())
+-                    if m is not None):
+-            del header[key]
++        for sel in [''] + [chr(i + ord('A')) for i in range(26)]:
++            for prefix in ('A', 'B', 'AP', 'BP'):
++                for i in range(20):
++                    for j in range(20):
++                        key = '{0}_{1}_{2}{3}'.format(prefix, i, j, sel)
++                        if key in header:
++                            del header[key]
+ 
+     def _read_sip_kw(self, header):
+         """
diff --git a/debian/patches/series b/debian/patches/series
index 82acab5..c4b567f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 mark_known_failures.patch
 disable_helper.patch
+downgrade_astropy_wcs_py.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/python-astropy.git



More information about the Debian-astro-commits mailing list