[med-svn] [Git][med-team/python-cogent][master] Fix suite fails with latest matplotlib

Andreas Tille gitlab at salsa.debian.org
Tue Jun 5 21:09:18 BST 2018


Andreas Tille pushed to branch master at Debian Med / python-cogent


Commits:
e29c6cdb by Andreas Tille at 2018-06-05T21:53:43+02:00
Fix suite fails with latest matplotlib

- - - - -


4 changed files:

- debian/changelog
- + debian/patches/numpy-doctests.patch
- + debian/patches/numpy_xor.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,8 +7,9 @@ python-cogent (1.9-12) UNRELEASED; urgency=medium
   * debhelper 11
   * Point Vcs fields to salsa.debian.org
   * Standards-Version: 4.1.4
+  * Fix suite fails with latest matplotlib
 
- -- Andreas Tille <tille at debian.org>  Wed, 28 Mar 2018 19:03:41 +0200
+ -- Andreas Tille <tille at debian.org>  Tue, 05 Jun 2018 21:47:29 +0200
 
 python-cogent (1.9-11) unstable; urgency=medium
 


=====================================
debian/patches/numpy-doctests.patch
=====================================
--- /dev/null
+++ b/debian/patches/numpy-doctests.patch
@@ -0,0 +1,26 @@
+Description: Ensure doctests pass with different numpy versions
+ The numpy output format changed with numpy 1.14 and this causes doctests to
+ fail if raw numerical output is compared. See
+ https://wiki.debian.org/ContinuousIntegration/TriagingTips/numpy-1.14-doctests
+Author: Stuart Prescott <stuart at debian.org>
+Last-Update: Tue, 05 Jun 2018 15:32:46 +0000 (UTC)
+Origin: https://github.com/pycogent/pycogent/files/2072985/numpy-doctests.patch
+Bug-Debian: https://bugs.debian.org/899205
+
+--- a/tests/alltests.py
++++ b/tests/alltests.py
+@@ -6,6 +6,14 @@
+ import doctest, cogent.util.unit_test as unittest, sys, os
+ from cogent.util.misc import app_path
+ 
++# Whitespace changes between numpy 1.13 and 1.14 will cause the doctests
++# to fail; when doctests are updated to 1.14 format, this can be removed.
++try:    # CRUFT
++    import numpy as np
++    np.set_printoptions(legacy='1.13')
++except TypeError:
++    pass
++
+ __author__ = "Peter Maxwell and Gavin Huttley"
+ __copyright__ = "Copyright 2007-2016, The Cogent Project"
+ __credits__ = ["Peter Maxwell", "Gavin Huttley", "Rob Knight",


=====================================
debian/patches/numpy_xor.patch
=====================================
--- /dev/null
+++ b/debian/patches/numpy_xor.patch
@@ -0,0 +1,33 @@
+Description: Use xor rather than subtraction on booleans
+ Numpy no longer accepts the ambiguous construction of a-b when a and b are bools.
+ Normally, this can be replaced with XORs.
+Author: Stuart Prescott <stuart at debian.org>
+Last-Update: Tue, 05 Jun 2018 15:32:46 +0000 (UTC)
+Origin: https://github.com/pycogent/pycogent/files/2072984/numpy_xor.patch
+Bug-Debian: https://bugs.debian.org/899205
+
+--- a/cogent/core/sequence.py
++++ b/cogent/core/sequence.py
+@@ -1248,7 +1248,7 @@
+         gap_indices = map(self.Alphabet.index, self.MolType.Gaps)
+         valid_indices = self._data < len(self.Alphabet)
+         for i in gap_indices:
+-            valid_indices -= self._data == i
++            valid_indices ^= self._data == i
+         result = compress(valid_indices, self._data)
+         return self.__class__(result, Info=self.Info)
+ 
+--- a/cogent/maths/distance_transform.py
++++ b/cogent/maths/distance_transform.py
+@@ -670,9 +670,9 @@
+         return zeros((0,0),'d')
+     dists = zeros((numrows,numrows),'d')
+     for i in range(numrows):
+-        r1 = datamtx[i] # cache here
++        r1 = datamtx[i].astype(dists.dtype) # cache here
+         for j in range(i):
+-            dists[i,j] = dists[j,i] = sum(abs(r1 - datamtx[j]))
++            dists[i,j] = dists[j,i] = sum(abs(r1 - datamtx[j].astype(dists.dtype)))
+             
+     return dists
+ 


=====================================
debian/patches/series
=====================================
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,5 @@ skip_weak_tests.patch
 adapt_to_ncbi-data_201609.patch
 ignore_numpy_test_issue.patch
 usr_bin_ls.patch
+numpy_xor.patch
+numpy-doctests.patch



View it on GitLab: https://salsa.debian.org/med-team/python-cogent/commit/e29c6cdbf0f3cb2cf8f6a18a79359fdbb6b76d8a

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-cogent/commit/e29c6cdbf0f3cb2cf8f6a18a79359fdbb6b76d8a
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20180605/04848a05/attachment-0001.html>


More information about the debian-med-commit mailing list