[python-astropy] 01/02: Include upstream fixes to build on python-3.4. Closes: #734293
Ole Streicher
olebole-guest at moszumanska.debian.org
Wed Jan 15 11:20:22 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 83fd0c236f70f0605fbf4f9ef3ffdff5600095fa
Author: Ole Streicher <debian at liska.ath.cx>
Date: Wed Jan 15 09:59:05 2014 +0100
Include upstream fixes to build on python-3.4. Closes: #734293
---
debian/changelog | 6 ++
debian/patches/python3.4.patch | 210 +++++++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 217 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 5282da3..8567ee1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+python-astropy (0.3-5) unstable; urgency=low
+
+ * Include upstream fixes to build on python-3.4. Closes: #734293
+
+ -- Ole Streicher <debian at liska.ath.cx> Wed, 15 Jan 2014 09:57:05 +0100
+
python-astropy (0.3-4) unstable; urgency=low
* Mark known s390 failures as xfail.
diff --git a/debian/patches/python3.4.patch b/debian/patches/python3.4.patch
new file mode 100644
index 0000000..fccc907
--- /dev/null
+++ b/debian/patches/python3.4.patch
@@ -0,0 +1,210 @@
+From: Thomas Robitaille <thomas.robitaille at gmail.com>
+Date: Mon, 6 Jan 2014 12:14:00 +0100
+Subject: Fixes for Python 3.4.
+ This merges the patches from the pull request #1945: b3942c4, f653064,
+ 16ae7a6, 1d51d8e, 07806be.
+Origin: https://github.com/astropy/astropy/pull/1945
+Bug-Debian: http://bugs.debian.org/734293
+--- a/astropy/logger.py
++++ b/astropy/logger.py
+@@ -551,9 +551,13 @@
+ if isinstance(level, int):
+ rv = level
+ elif str(level) == level:
+- if level not in logging._levelNames:
++ if sys.version_info[:2] >= (3, 4):
++ names = logging._nameToLevel
++ else:
++ names = logging._levelNames
++ if level not in names:
+ raise ValueError("Unknown level: %r" % level)
+- rv = logging._levelNames[level]
++ rv = names[level]
+ else:
+ raise TypeError("Level not an integer or a valid string: %r" % level)
+ return rv
+--- a/astropy/nddata/flag_collection.py
++++ b/astropy/nddata/flag_collection.py
+@@ -40,6 +40,6 @@
+ if value.shape == self.shape:
+ OrderedDict.__setitem__(self, item, value, **kwargs)
+ else:
+- raise ValueError("flags array shape {0:s} does not match data shape {1:s}".format(value.shape, self.shape))
++ raise ValueError("flags array shape {0} does not match data shape {1}".format(value.shape, self.shape))
+ else:
+ raise TypeError("flags should be given as a Numpy array")
+--- a/astropy/table/np_utils.py
++++ b/astropy/table/np_utils.py
+@@ -81,7 +81,7 @@
+ col_name_count = _counter(col_name_list)
+ repeated_names = [name for name, count in col_name_count.items() if count > 1]
+ if repeated_names:
+- raise TableMergeError('Merging column names resulted in duplicates: {0:s}. '
++ raise TableMergeError('Merging column names resulted in duplicates: {0}. '
+ 'Change uniq_col_name or table_names args to fix this.'
+ .format(repeated_names))
+
+--- a/CHANGES.rst
++++ b/CHANGES.rst
+@@ -658,6 +658,8 @@
+ ``CUNIT`` field that was changed. (This requires that astropy
+ was built with the locally distributed version of wcslib). [#1854]
+
++ - Fixed compatibility with Python 3.4. [#1945]
++
+ Other Changes and Additions
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+--- a/astropy/cosmology/tests/test_cosmology.py
++++ b/astropy/cosmology/tests/test_cosmology.py
+@@ -95,40 +95,40 @@
+ """ Test string representation of built in classes"""
+ cosmo = core.LambdaCDM(70, 0.3, 0.5)
+ expected = 'LambdaCDM(H0=70 km / (Mpc s), Om0=0.3, Ode0=0.5, Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0. 0. 0.] eV)'
+- assert "{0:s}".format(cosmo) == expected
++ assert str(cosmo) == expected
+
+ cosmo = core.LambdaCDM(70, 0.3, 0.5, m_nu=u.Quantity(0.01, u.eV))
+ expected = 'LambdaCDM(H0=70 km / (Mpc s), Om0=0.3, Ode0=0.5, Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0.01 0.01 0.01] eV)'
+- assert "{0:s}".format(cosmo) == expected
++ assert str(cosmo) == expected
+
+ cosmo = core.FlatLambdaCDM(50.0, 0.27)
+ expected = 'FlatLambdaCDM(H0=50 km / (Mpc s), Om0=0.27, Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0. 0. 0.] eV)'
+- assert "{0:s}".format(cosmo) == expected
++ assert str(cosmo) == expected
+
+ cosmo = core.wCDM(60.0, 0.27, 0.6, w0=-0.8, name='test1')
+ expected = 'wCDM(name="test1", H0=60 km / (Mpc s), Om0=0.27, Ode0=0.6, w0=-0.8, Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0. 0. 0.] eV)'
+- assert "{0:s}".format(cosmo) == expected
++ assert str(cosmo) == expected
+
+ cosmo = core.FlatwCDM(65.0, 0.27, w0=-0.6, name='test2')
+ expected = 'FlatwCDM(name="test2", H0=65 km / (Mpc s), Om0=0.27, w0=-0.6, Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0. 0. 0.] eV)'
+- assert "{0:s}".format(cosmo) == expected
++ assert str(cosmo) == expected
+
+ cosmo = core.w0waCDM(60.0, 0.25, 0.4, w0=-0.6, wa=0.1, name='test3')
+ expected = 'w0waCDM(name="test3", H0=60 km / (Mpc s), Om0=0.25, Ode0=0.4, w0=-0.6, wa=0.1, Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0. 0. 0.] eV)'
+- assert "{0:s}".format(cosmo) == expected
++ assert str(cosmo) == expected
+
+ cosmo = core.Flatw0waCDM(55.0, 0.35, w0=-0.9, wa=-0.2, name='test4')
+ expected = 'Flatw0waCDM(name="test4", H0=55 km / (Mpc s), Om0=0.35, w0=-0.9, Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0. 0. 0.] eV)'
+- assert "{0:s}".format(cosmo) == expected
++ assert str(cosmo) == expected
+
+ cosmo = core.wpwaCDM(50.0, 0.3, 0.3, wp=-0.9, wa=-0.2, zp=0.3, name='test5')
+ expected = 'wpwaCDM(name="test5", H0=50 km / (Mpc s), Om0=0.3, Ode0=0.3, wp=-0.9, wa=-0.2, zp=0.3, Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0. 0. 0.] eV)'
+- assert "{0:s}".format(cosmo) == expected
++ assert str(cosmo) == expected
+
+ cosmo = core.w0wzCDM(55.0, 0.4, 0.8, w0=-1.05, wz=-0.2,
+ m_nu=u.Quantity([0.001, 0.01, 0.015], u.eV))
+ expected = 'w0wzCDM(H0=55 km / (Mpc s), Om0=0.4, Ode0=0.8, w0=-1.05, wz=-0.2 Tcmb0=2.725 K, Neff=3.04, m_nu=[ 0.001 0.01 0.015] eV)'
+- assert "{0:s}".format(cosmo) == expected
++ assert str(cosmo) == expected
+
+ @pytest.mark.skipif('not HAS_SCIPY')
+ def test_flat_z1():
+--- a/astropy/cosmology/core.py
++++ b/astropy/cosmology/core.py
+@@ -244,14 +244,14 @@
+ def _namelead(self):
+ """ Helper function for constructing __repr__"""
+ if self.name is None:
+- return "{0:s}(".format(self.__class__.__name__)
++ return "{0}(".format(self.__class__.__name__)
+ else:
+- return "{0:s}(name=\"{1:s}\", ".format(self.__class__.__name__,
++ return "{0}(name=\"{1}\", ".format(self.__class__.__name__,
+ self.name)
+
+ def __repr__(self):
+- retstr = "{0:s}H0={1:.3g}, Om0={2:.3g}, Ode0={3:.3g}, "\
+- "Tcmb0={4:.4g}, Neff={5:.3g}, m_nu={6:s})"
++ retstr = "{0}H0={1:.3g}, Om0={2:.3g}, Ode0={3:.3g}, "\
++ "Tcmb0={4:.4g}, Neff={5:.3g}, m_nu={6})"
+ return retstr.format(self._namelead(), self._H0, self._Om0, self._Ode0,
+ self._Tcmb0, self._Neff, self.m_nu)
+
+@@ -1465,8 +1465,8 @@
+ return 1.0 / np.sqrt(zp1 ** 3 * (Or * zp1 + Om0) + Ode0)
+
+ def __repr__(self):
+- retstr = "{0:s}H0={1:.3g}, Om0={2:.3g}, Tcmb0={3:.4g}, "\
+- "Neff={4:.3g}, m_nu={5:s})"
++ retstr = "{0}H0={1:.3g}, Om0={2:.3g}, Tcmb0={3:.4g}, "\
++ "Neff={4:.3g}, m_nu={5})"
+ return retstr.format(self._namelead(), self._H0, self._Om0,
+ self._Tcmb0, self._Neff, self.m_nu)
+
+@@ -1643,8 +1643,8 @@
+ Ode0 * zp1 ** (3 * (1 + w0)))
+
+ def __repr__(self):
+- retstr = "{0:s}H0={1:.3g}, Om0={2:.3g}, Ode0={3:.3g}, w0={4:.3g}, "\
+- "Tcmb0={5:.4g}, Neff={6:.3g}, m_nu={7:s})"
++ retstr = "{0}H0={1:.3g}, Om0={2:.3g}, Ode0={3:.3g}, w0={4:.3g}, "\
++ "Tcmb0={5:.4g}, Neff={6:.3g}, m_nu={7})"
+ return retstr.format(self._namelead(), self._H0, self._Om0,
+ self._Ode0, self._w0, self._Tcmb0, self._Neff,
+ self.m_nu)
+@@ -1769,8 +1769,8 @@
+ Ode0 * zp1 ** (3 * (1 + w0)))
+
+ def __repr__(self):
+- retstr = "{0:s}H0={1:.3g}, Om0={2:.3g}, w0={3:.3g}, Tcmb0={4:.4g}, "\
+- "Neff={5:.3g}, m_nu={6:s})"
++ retstr = "{0}H0={1:.3g}, Om0={2:.3g}, w0={3:.3g}, Tcmb0={4:.4g}, "\
++ "Neff={5:.3g}, m_nu={6})"
+ return retstr.format(self._namelead(), self._H0, self._Om0, self._w0,
+ self._Tcmb0, self._Neff, self.m_nu)
+
+@@ -1906,9 +1906,9 @@
+ np.exp(-3 * self._wa * z / zp1)
+
+ def __repr__(self):
+- retstr = "{0:s}H0={1:.3g}, Om0={2:.3g}, "\
++ retstr = "{0}H0={1:.3g}, Om0={2:.3g}, "\
+ "Ode0={3:.3g}, w0={4:.3g}, wa={5:.3g}, Tcmb0={6:.4g}, "\
+- "Neff={7:.3g}, m_nu={8:s})"
++ "Neff={7:.3g}, m_nu={8})"
+ return retstr.format(self._namelead(), self._H0, self._Om0,
+ self._Ode0, self._w0, self._wa,
+ self._Tcmb0, self._Neff, self.m_nu)
+@@ -1978,8 +1978,8 @@
+ self._wa = float(wa)
+
+ def __repr__(self):
+- retstr = "{0:s}H0={1:.3g}, Om0={2:.3g}, "\
+- "w0={3:.3g}, Tcmb0={4:.4g}, Neff={5:.3g}, m_nu={6:s})"
++ retstr = "{0}H0={1:.3g}, Om0={2:.3g}, "\
++ "w0={3:.3g}, Tcmb0={4:.4g}, Neff={5:.3g}, m_nu={6})"
+ return retstr.format(self._namelead(), self._H0, self._Om0, self._w0,
+ self._Tcmb0, self._Neff, self.m_nu)
+
+@@ -2134,9 +2134,9 @@
+ np.exp(-3 * self._wa * z / zp1)
+
+ def __repr__(self):
+- retstr = "{0:s}H0={1:.3g}, Om0={2:.3g}, Ode0={3:.3g}, wp={4:.3g}, "\
++ retstr = "{0}H0={1:.3g}, Om0={2:.3g}, Ode0={3:.3g}, wp={4:.3g}, "\
+ "wa={5:.3g}, zp={6:.3g}, Tcmb0={7:.4g}, Neff={8:.3g}, "\
+- "m_nu={9:s})"
++ "m_nu={9})"
+ return retstr.format(self._namelead(), self._H0, self._Om0,
+ self._Ode0, self._wp, self._wa, self._zp,
+ self._Tcmb0, self._Neff, self.m_nu)
+@@ -2279,9 +2279,9 @@
+ np.exp(-3 * self._wz * z)
+
+ def __repr__(self):
+- retstr = "{0:s}H0={1:.3g}, Om0={2:.3g}, "\
++ retstr = "{0}H0={1:.3g}, Om0={2:.3g}, "\
+ "Ode0={3:.3g}, w0={4:.3g}, wz={5:.3g} Tcmb0={6:.4g}, "\
+- "Neff={7:.3g}, m_nu={8:s})"
++ "Neff={7:.3g}, m_nu={8})"
+ return retstr.format(self._namelead(), self._H0, self._Om0,
+ self._Ode0, self._w0, self._wz, self._Tcmb0,
+ self._Neff, self.m_nu)
diff --git a/debian/patches/series b/debian/patches/series
index 8d08120..7c30f63 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
mark_known_failures.patch
parallel_fk4_no_fk4.pytch
CUNITfix.patch
+python3.4.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-astropy.git
More information about the debian-science-commits
mailing list