[SCM] Core functionality for performing astronomy and astrophysics with Python branch, debian, updated. b1a8768b6b2fc4a926436a9993a6ebbc3603ba7f

Ole Streicher debian at liska.ath.cx
Tue May 28 11:39:22 UTC 2013


The following commit has been merged in the debian branch:
commit b1a8768b6b2fc4a926436a9993a6ebbc3603ba7f
Author: Ole Streicher <debian at liska.ath.cx>
Date:   Wed May 22 09:36:37 2013 +0200

    Adjust for new upstream version

diff --git a/debian/changelog b/debian/changelog
index 3e95afa..212bf28 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+python-astropy (0.2.2-1) unstable; urgency=low
+
+  * New upstream version; incorporates all previous patches
+
+ -- Ole Streicher <debian at liska.ath.cx>  Wed, 22 May 2013 09:17:08 +0200
+
 python-astropy (0.2.1-1) unstable; urgency=low
 
   * Fix FTBS (unit test failure) on HURD
diff --git a/debian/copyright b/debian/copyright
index 8fa138d..16ebe85 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -8,10 +8,11 @@ Files: * astropy/io/fits/*
  astropy/sphinx/ext/traitsdoc.py astropy/extern/configobj_*/*
 Copyright: Copyright (c) 2011, Astropy Developers,
  2004-2005 Association of Universities for Research in Astronomy,
- 2006, Enthought, Inc.,
+ 2006 Enthought, Inc.,
  2010-2011 Smithsonian Astrophysical Observatory,
- 2003-2010, Michael Foord, Mark Andrews, Nicola Larosa,
- 1995-2010 Jean-loup Gailly and Mark Adler
+ 2003-2010 Michael Foord, Mark Andrews, Nicola Larosa,
+ 1995-2010 Jean-loup Gailly and Mark Adler,
+ 2001-2011 David M. Beazley (Dabeaz LLC)
 License: BSD-3-Clause
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:
@@ -26,9 +27,9 @@ License: BSD-3-Clause
  .
  3. Neither the name of AURA and its representatives nor the names
  of the Smithsonian Astrophysical Observatory, Enthought Inc., Michael Foord,
- the name of Voidspace or the names of its contributors may not be used to
- endorse or promote products derived from this software without specific prior
- written permission.
+ the name of Voidspace, the names of its contributors, David Beazley, or 
+ Dabeaz LLC  may not be used to endorse or promote products derived from this
+ software without specific prior written permission.
  .
  THIS SOFTWARE IS PROVIDED BY ITS AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
diff --git a/debian/patches/disable_mmap.patch b/debian/patches/disable_mmap.patch
deleted file mode 100644
index e861346..0000000
--- a/debian/patches/disable_mmap.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Author: Ole Streicher <debian at liska.ath.cx>
-Description: Q&D Fix FTBS (testing failure) on GNU/Hurd. 
- On GNU/Hurd, fflush() seems to be not implemented on mmap files. Until this
- is fixed upstream, this is a Q&D patch.
-Bug: https://github.com/astropy/astropy/issues/968
---- a/astropy/io/fits/__init__.py
-+++ b/astropy/io/fits/__init__.py
-@@ -37,7 +37,7 @@
-     'whitespace intact.')
- 
- USE_MEMMAP = ConfigurationItem(
--    'use_memmap', True,
-+    'use_memmap', False,
-     'If True, use memory-mapped file access to read/write the data in '
-     'FITS files. This generally provides better performance, especially '
-     'for large files, but may affect performance in I/O-heavy '
diff --git a/debian/patches/fix_bigendian_ftbs.patch b/debian/patches/fix_bigendian_ftbs.patch
deleted file mode 100644
index 62613aa..0000000
--- a/debian/patches/fix_bigendian_ftbs.patch
+++ /dev/null
@@ -1,166 +0,0 @@
-Author: Michael Droettboom <mdboom at gmail.com>
-Description: Fix a number of byteswapping bugs
- I hope this will fix #963.
- .
- I have tested it under qemu ppc emulation with Debian 6 using the system
- Python 2.6, and pip-installed Numpy 1.7.1 (testing Numpy 1.4.1 has too many
- limitations).
-Url: https://github.com/astropy/astropy/pull/1003
-Bug: https://github.com/astropy/astropy/issues/963
---- a/astropy/io/fits/hdu/compressed.py
-+++ b/astropy/io/fits/hdu/compressed.py
-@@ -1216,13 +1216,6 @@
-             self.shape != self.data.shape):
-             self.updateHeaderData(self.header)
- 
--        # put data in machine native byteorder on little endian machines
--        # for handing off to the compression code
--        if sys.byteorder == 'little':
--            swap_types = ('>',)
--        else:
--            swap_types = ('>', '=')
--
-         # TODO: This is copied right out of _ImageBaseHDU._writedata_internal;
-         # it would be cool if we could use an internal ImageHDU and use that to
-         # write to a buffer for compression or something. See ticket #88
-@@ -1232,24 +1225,23 @@
-             # Convert the unsigned array to signed
-             self.data = np.array(
-                 self.data - _unsigned_zero(self.data.dtype),
--                dtype='<i%d' % self.data.dtype.itemsize)
-+                dtype='=i%d' % self.data.dtype.itemsize)
-             should_swap = False
-         else:
--            byteorder = self.data.dtype.str[0]
--            should_swap = (byteorder in swap_types)
-+            should_swap = not self.data.dtype.isnative
- 
-         if should_swap:
-             self.data.byteswap(True)
- 
--        nrows = self._header['NAXIS2']
--        tbsize = self._header['NAXIS1'] * nrows
-+        try:
-+            nrows = self._header['NAXIS2']
-+            tbsize = self._header['NAXIS1'] * nrows
- 
--        self._header['PCOUNT'] = 0
--        if 'THEAP' in self._header:
--            del self._header['THEAP']
--        self._theap = tbsize
-+            self._header['PCOUNT'] = 0
-+            if 'THEAP' in self._header:
-+                del self._header['THEAP']
-+            self._theap = tbsize
- 
--        try:
-             # Compress the data.
-             # The current implementation of compress_hdu assumes the empty
-             # compressed data table has already been initialized in
---- a/astropy/io/votable/converters.py
-+++ b/astropy/io/votable/converters.py
-@@ -8,6 +8,7 @@
- 
- # STDLIB
- import re
-+import sys
- from struct import unpack as struct_unpack
- from struct import pack as struct_pack
- 
-@@ -41,6 +42,18 @@
- _zero_byte = b'\0'
- 
- 
-+if sys.byteorder == 'little':
-+    def _ensure_bigendian(x):
-+        if x.dtype.byteorder != '>':
-+            return x.byteswap()
-+        return x
-+else:
-+    def _ensure_bigendian(x):
-+        if x.dtype.byteorder == '<':
-+            return x.byteswap()
-+        return x
-+
-+
- def _make_masked_array(data, mask):
-     """
-     Masked arrays of zero length that also have a mask of zero length
-@@ -517,8 +530,7 @@
- 
-     def binoutput(self, value, mask):
-         filtered = self._base.filter_array(value, mask)
--        if filtered.dtype.byteorder != '>':
--            filtered = filtered.byteswap()
-+        filtered = _ensure_bigendian(filtered)
-         return filtered.tostring()
- 
- 
-@@ -637,8 +649,7 @@
-         if mask:
-             return self._null_binoutput
- 
--        if value.dtype.byteorder != '>':
--            value = value.byteswap()
-+        value = _ensure_bigendian(value)
-         return value.tostring()
- 
-     def _filter_nan(self, value, mask):
-@@ -721,8 +732,8 @@
-                 vo_raise(W31)
-             else:
-                 value = self.null
--        if value.dtype.byteorder != '>':
--            value = value.byteswap()
-+
-+        value = _ensure_bigendian(value)
-         return value.tostring()
- 
-     def filter_array(self, value, mask):
---- a/astropy/io/votable/tests/vo_test.py
-+++ b/astropy/io/votable/tests/vo_test.py
-@@ -97,7 +97,7 @@
-         _debug_python_based_parser=_python_based)
-     table = votable.get_first_table()
- 
--    assert table.array.dtype == [
-+    dtypes = [
-         (('string test', 'string_test'), '|O8'),
-         (('fixed string test', 'string_test_2'), '|S10'),
-         ('unicode_test', '|O8'),
-@@ -127,6 +127,14 @@
-         ('doublearray', '|O8'),
-         ('bitarray2', '|b1', (16,))
-         ]
-+    if sys.byteorder == 'big':
-+        new_dtypes = []
-+        for dtype in dtypes:
-+            dtype = list(dtype)
-+            dtype[1] = dtype[1].replace('<', '>')
-+            new_dtypes.append(tuple(dtype))
-+        dtypes = new_dtypes
-+    assert table.array.dtype == dtypes
- 
-     votable.to_xml(join(TMP_DIR, "regression.tabledata.xml"),
-                    _debug_python_based_parser=_python_based)
---- a/astropy/table/tests/test_row.py
-+++ b/astropy/table/tests/test_row.py
-@@ -1,4 +1,6 @@
- # Licensed under a 3-clause BSD style license - see LICENSE.rst
-+import sys
-+
- from distutils import version
- import numpy as np
- 
-@@ -62,7 +64,10 @@
-         assert row.columns is table.columns
-         with pytest.raises(IndexError):
-             row[2]
--        assert str(row.dtype) == "[('a', '<i8'), ('b', '<i8')]"
-+        if sys.byteorder == 'little':
-+            assert str(row.dtype) == "[('a', '<i8'), ('b', '<i8')]"
-+        else:
-+            assert str(row.dtype) == "[('a', '>i8'), ('b', '>i8')]"
- 
-     def test_ref(self):
-         """Row is a reference into original table data"""
diff --git a/debian/patches/fix_hurd_ftbs.patch b/debian/patches/fix_hurd_ftbs.patch
deleted file mode 100644
index 24f783f..0000000
--- a/debian/patches/fix_hurd_ftbs.patch
+++ /dev/null
@@ -1,179 +0,0 @@
-Author: "Erik M. Bray" <embray at stsci.edu>
-Date: Mon, 29 Apr 2013 21:47:46 -0400
-Description: Check for mmap and flush()
- If opening a file in a writeable mode a warning is raised and mmap is
- disabled even if it was explicitly asked for.  This is done through a
- new check that mmap.flush() is available--this check is performed on all
- platforms and should require minimal overhead but we'll see... (the
- check is only performed the first time an attempt is made to open a file
- in writeable mode)
---- a/astropy/io/fits/file.py
-+++ b/astropy/io/fits/file.py
-@@ -4,6 +4,7 @@
- from __future__ import with_statement
- 
- import gzip
-+import mmap
- import os
- import sys
- import tempfile
-@@ -48,6 +49,9 @@
-     Represents a FITS file on disk (or in some other file-like object).
-     """
- 
-+    # See self._test_mmap
-+    _mmap_available = None
-+
-     def __init__(self, fileobj=None, mode='readonly', memmap=False):
-         if fileobj is None:
-             self.__file = None
-@@ -123,8 +127,13 @@
-             self.size = self.__file.tell()
-             self.__file.seek(pos)
- 
--        if self.memmap and not isfile(self.__file):
--            self.memmap = False
-+        if self.memmap:
-+            if not isfile(self.__file):
-+                self.memmap = False
-+            elif not self.readonly and not self._test_mmap():
-+                # Test mmap.flush--see
-+                # https://github.com/astropy/astropy/issues/968
-+                self.memmap = False
- 
-     def __repr__(self):
-         return '<%s.%s %s>' % (self.__module__, self.__class__.__name__,
-@@ -352,3 +361,43 @@
-             self.__file = fileobj_open(self.name, PYTHON_MODES[mode])
-             # Make certain we're back at the beginning of the file
-         self.__file.seek(0)
-+
-+    def _test_mmap(self):
-+        """Tests that mmap, and specifically mmap.flush works.  This may
-+        be the case on some uncommon platforms (see
-+        https://github.com/astropy/astropy/issues/968).
-+
-+        If mmap.flush is found not to work, ``self.memmap = False`` is
-+        se and a warning is issued.
-+        """
-+
-+        if self._mmap_available is not None:
-+            return self._mmap_available
-+
-+        tmpfd, tmpname = tempfile.mkstemp()
-+        try:
-+            # Windows does not allow mappings on empty files
-+            os.write(tmpfd, b' ')
-+            os.fsync(tmpfd)
-+            try:
-+                mm = mmap.mmap(tmpfd, 1, access=mmap.ACCESS_WRITE)
-+            except mmap.error as e:
-+                warnings.warn('Failed to create mmap: %s; mmap use will be '
-+                              'disabled' % str(e))
-+                _File._mmap_available = False
-+                return False
-+            try:
-+                mm.flush()
-+            except mmap.error:
-+                warnings.warn('mmap.flush is unavailable on this platform; '
-+                              'using mmap in writeable mode will be disabled')
-+                _File._mmap_available = False
-+                return False
-+            finally:
-+                mm.close()
-+        finally:
-+            os.close(tmpfd)
-+            os.remove(tmpname)
-+
-+        _File._mmap_available = True
-+        return True
---- a/astropy/io/fits/tests/test_core.py
-+++ b/astropy/io/fits/tests/test_core.py
-@@ -2,7 +2,9 @@
- 
- import gzip
- import io
-+import mmap
- import os
-+import shutil
- import warnings
- import zipfile
- 
-@@ -14,6 +16,7 @@
- from . import FitsTestCase
- from .util import ignore_warnings
- from ..convenience import _getext
-+from ..file import _File
- 
- 
- class TestCore(FitsTestCase):
-@@ -473,6 +476,41 @@
- 
-         assert old_mode == os.stat(filename).st_mode
- 
-+    def test_mmap_unwriteable(self):
-+        """Regression test for https://github.com/astropy/astropy/issues/968
-+
-+        Temporarily patches mmap.mmap to exhibit platform-specific bad
-+        behavior.
-+        """
-+
-+        class MockMmap(mmap.mmap):
-+            def flush(self):
-+                raise mmap.error('flush is broken on this platform')
-+
-+        old_mmap = mmap.mmap
-+        mmap.mmap = MockMmap
-+
-+        # Force the mmap test to be rerun
-+        _File._mmap_available = None
-+
-+        try:
-+            # TODO: Use self.copy_file once it's merged into Astropy
-+            shutil.copy(self.data('test0.fits'), self.temp('test0.fits'))
-+            with warnings.catch_warnings(record=True) as w:
-+                with fits.open(self.temp('test0.fits'), mode='update',
-+                               memmap=True) as h:
-+                    h[1].data[0, 0] = 999
-+
-+                assert len(w) == 1
-+                assert 'mmap.flush is unavailable' in str(w[0].message)
-+
-+            # Double check that writing without mmap still worked
-+            with fits.open(self.temp('test0.fits')) as h:
-+                assert h[1].data[0, 0] == 999
-+        finally:
-+            mmap.mmap = old_mmap
-+            _File._mmap_available = None
-+
-     def _make_gzip_file(self, filename='test0.fits.gz'):
-         gzfile = self.temp(filename)
-         with open(self.data('test0.fits'), 'rb') as f:
---- a/CHANGES.rst
-+++ b/CHANGES.rst
-@@ -40,6 +40,9 @@
-   - Fixed a bug in fitsdiff that reported two header keywords contaning NaN
-     as having different values.
- 
-+  - Fixed an obscure issue that can occur on systems that don't have flush to
-+    memory-mapped files implemented (namely GNU Hurd). [#968]
-+
- - ``astropy.io.votable``
- 
-   - Fixed links to the ``astropy.io.votable`` documentation in the VOTable
---- a/docs/known_issues.rst
-+++ b/docs/known_issues.rst
-@@ -66,3 +66,13 @@
- fail.  
- 
- The solution is to use a more recent version of Numpy.
-+
-+mmap support on GNU Hurd
-+------------------------
-+
-+On Hurd and possibly other platforms ``flush()`` on memory-mapped files is not
-+implemented, so writing changes to a mmap'd file may not be reliable and is
-+this disabled.  Attempting to open a file in writeable mode with mmap will
-+result in a warning (and mmap will be disabled on the file automatically).
-+
-+See: https://github.com/astropy/astropy/issues/968
diff --git a/debian/patches/fix_mips_ftbs.patch b/debian/patches/fix_mips_ftbs.patch
deleted file mode 100644
index f86cf14..0000000
--- a/debian/patches/fix_mips_ftbs.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-Author: Michael Droettboom <mdboom at gmail.com>
-Description: Fix FTBS on MIPS
-Bug: https://github.com/astropy/astropy/pull/1010
---- a/astropy/io/votable/converters.py
-+++ b/astropy/io/votable/converters.py
-@@ -481,9 +481,8 @@
-         self._memsize = np.dtype(self.format).itemsize
-         self._bigendian_format = '>' + self.format
- 
--        self.default = (
--            np.ones(arraysize, dtype=self._base.format) *
--            self._base.default)
-+        self.default = np.empty(arraysize, dtype=self._base.format)
-+        self.default[...] = self._base.default
- 
-     def parse(self, value, config={}, pos=None):
-         parts = self._splitter(value, config, pos)
---- a/astropy/io/votable/exceptions.py
-+++ b/astropy/io/votable/exceptions.py
-@@ -156,6 +156,9 @@
-         result['is_exception'] = False
-         result['is_other'] = False
-         result['is_something'] = False
-+        if not isinstance(line, unicode):
-+            line = line.decode('utf-8')
-+        result['message'] = line
- 
-     return result
- 
---- a/astropy/io/votable/table.py
-+++ b/astropy/io/votable/table.py
-@@ -239,7 +239,7 @@
-             w = exceptions.parse_vowarning(warning)
- 
-             if not w['is_something']:
--                output.write(warning)
-+                output.write(w['message'])
-                 output.write(u'\n\n')
-             else:
-                 line = xml_lines[w['nline'] - 1]
---- a/astropy/io/votable/tests/vo_test.py
-+++ b/astropy/io/votable/tests/vo_test.py
-@@ -564,6 +564,7 @@
-                             [[ True,  True],
-                              [ True,  True]]])
- 
-+    @pytest.mark.xfail
-     def test_double_array(self):
-         assert issubclass(self.array['doublearray'].dtype.type,
-                           np.object_)
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index cce875f..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1,3 +0,0 @@
-fix_bigendian_ftbs.patch
-fix_mips_ftbs.patch
-fix_hurd_ftbs.patch

-- 
Core functionality for performing astronomy and astrophysics with Python



More information about the debian-science-commits mailing list