[python-astropy] 01/02: Fix checksum on 32-bit

Ole Streicher olebole-guest at moszumanska.debian.org
Sun Jul 6 19:24:36 UTC 2014


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

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

commit 77b2ee7e3e6fcb80382ccf3017a2154d9aa52125
Author: Ole Streicher <debian at liska.ath.cx>
Date:   Sat May 17 17:05:52 2014 +0200

    Fix checksum on 32-bit
---
 debian/changelog                         |  6 ++++++
 debian/patches/fix_checksum_test.patch   | 36 ++++++++++++++++++++++++++++++++
 debian/patches/mark_known_failures.patch | 22 -------------------
 debian/patches/series                    |  1 +
 4 files changed, 43 insertions(+), 22 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index be94a8e..736570e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+python-astropy (0.3.2-3) unstable; urgency=low
+
+  * Fix checksum calculation and test on 32-bit
+
+ -- Ole Streicher <debian at liska.ath.cx>  Sat, 17 May 2014 17:05:58 +0200
+
 python-astropy (0.3.2-2) unstable; urgency=low
 
   * Mark known failures as xfail.
diff --git a/debian/patches/fix_checksum_test.patch b/debian/patches/fix_checksum_test.patch
new file mode 100644
index 0000000..15ea092
--- /dev/null
+++ b/debian/patches/fix_checksum_test.patch
@@ -0,0 +1,36 @@
+Author: Michael Droettboom <mdboom at gmail.com>
+Description: Fix checksum tests on 32-bit systems
+Url: https://github.com/astropy/astropy/pull/2484
+--- a/astropy/io/fits/hdu/base.py
++++ b/astropy/io/fits/hdu/base.py
+@@ -1581,8 +1581,8 @@
+ 
+         hi = sum32 >> u16
+         lo = sum32 & uFFFF
+-        hi += np.add.reduce(bytes[0::2])
+-        lo += np.add.reduce(bytes[1::2])
++        hi += np.add.reduce(bytes[0::2], dtype=np.uint64)
++        lo += np.add.reduce(bytes[1::2], dtype=np.uint64)
+ 
+         if (bytes.nbytes // 2) % 2:
+             lo += last << u8
+--- a/astropy/io/fits/tests/test_checksum.py
++++ b/astropy/io/fits/tests/test_checksum.py
+@@ -42,7 +42,7 @@
+         hdul.close()
+ 
+     def test_image_create(self):
+-        n = np.arange(100)
++        n = np.arange(100, dtype=np.int64)
+         hdu = fits.PrimaryHDU(n)
+         hdu.writeto(self.temp('tmp.fits'), clobber=True, checksum=True)
+         with fits.open(self.temp('tmp.fits'), checksum=True) as hdul:
+@@ -57,7 +57,7 @@
+                 assert hdul[0].header['DATASUM'] == '4950'
+ 
+     def test_nonstandard_checksum(self):
+-        hdu = fits.PrimaryHDU(np.arange(10.0 ** 6))
++        hdu = fits.PrimaryHDU(np.arange(10.0 ** 6, dtype=np.float64))
+         hdu.writeto(self.temp('tmp.fits'), clobber=True,
+                     checksum='nonstandard')
+         del hdu
diff --git a/debian/patches/mark_known_failures.patch b/debian/patches/mark_known_failures.patch
index 05febcf..4da5ddf 100644
--- a/debian/patches/mark_known_failures.patch
+++ b/debian/patches/mark_known_failures.patch
@@ -10,28 +10,6 @@
  def test_composite_static_matrix_transform():
      """
      Checks to make sure that CompositeStaticMatrixTransform 
---- a/astropy/io/fits/tests/test_checksum.py
-+++ b/astropy/io/fits/tests/test_checksum.py
-@@ -41,6 +41,9 @@
-         hdul = fits.open(self.data('checksum.fits'), checksum=True)
-         hdul.close()
- 
-+    # See https://github.com/astropy/astropy/issues/2171
-+    # fails on 32 bit platforms
-+    @pytest.mark.xfail
-     def test_image_create(self):
-         n = np.arange(100)
-         hdu = fits.PrimaryHDU(n)
-@@ -56,6 +59,9 @@
-                 assert hdul[0].header['CHECKSUM'] == 'ZHMkeGKjZGKjbGKj'
-                 assert hdul[0].header['DATASUM'] == '4950'
- 
-+    # See https://github.com/astropy/astropy/issues/2171
-+    # fails on 32 bit platforms
-+    @pytest.mark.xfail
-     def test_nonstandard_checksum(self):
-         hdu = fits.PrimaryHDU(np.arange(10.0 ** 6))
-         hdu.writeto(self.temp('tmp.fits'), clobber=True,
 --- a/astropy/io/fits/tests/test_connect.py
 +++ b/astropy/io/fits/tests/test_connect.py
 @@ -104,6 +104,9 @@
diff --git a/debian/patches/series b/debian/patches/series
index c8093a8..70f129b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 mark_known_failures.patch
+fix_checksum_test.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-science-commits mailing list