[med-svn] [Git][med-team/python-skbio][master] Patches: Support Pandas 1.1

Andreas Tille gitlab at salsa.debian.org
Wed Oct 21 10:13:17 BST 2020



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


Commits:
f5e1538c by Andreas Tille at 2020-10-21T11:13:03+02:00
Patches: Support Pandas 1.1

- - - - -


4 changed files:

- debian/changelog
- + debian/patches/pandas1.1-ordination-fix.patch
- + debian/patches/pandas1.1-valueerror.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+python-skbio (0.5.6-3.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Patches: Support Pandas 1.1. (Closes: #972548)
+
+ -- Stefano Rivera <stefanor at debian.org>  Tue, 20 Oct 2020 11:00:59 -0700
+
 python-skbio (0.5.6-3) unstable; urgency=medium
 
   * debhelper-compat 13 (routine-update)


=====================================
debian/patches/pandas1.1-ordination-fix.patch
=====================================
@@ -0,0 +1,137 @@
+From: Jamie Morton <jamietmorton at gmail.com>
+Date: Wed, 26 Aug 2020 10:37:27 -0600
+Subject: Ordination fix (#1720)
+
+* `skbio.stats.ordination` tests have been relaxed.
+
+* Fixes build errors for newer versions of NumPy, Pandas, and SciPy.
+
+* Corrected a criticial bug in `skbio.alignment.StripedSmithWaterman` /
+  `skbio.alignment.local_pairwise_align_ssw` which would cause the
+  formatting of the aligned sequences to misplace gap characters by the
+  number of gap characters present in the opposing aligned sequence up
+  to that point. This was caused by a faulty implementation of CIGAR
+  string parsing, see
+  [#1679](https://github.com/biocore/scikit-bio/pull/1679) for full
+  details.
+
+Origin: upstream, https://github.com/biocore/scikit-bio/pull/1720
+Bug-Upstream: https://github.com/biocore/scikit-bio/issues/1713
+---
+ CHANGELOG.md                                       |  5 ++
+ .../ordination/tests/test_redundancy_analysis.py   |  1 -
+ skbio/util/_testing.py                             | 59 ++++++++++++++--------
+ 3 files changed, 44 insertions(+), 21 deletions(-)
+
+diff --git a/CHANGELOG.md b/CHANGELOG.md
+index ebdfe7e..61ae9a1 100644
+--- a/CHANGELOG.md
++++ b/CHANGELOG.md
+@@ -23,6 +23,11 @@
+ ### Performance enhancements
+ 
+ ### Bug fixes
++* * `skbio.stats.ordination` tests have been relaxed. ([#1713](https://github.com/biocore/scikit-bio/issues/1713))
++
++* Fixes build errors for newer versions of NumPy, Pandas, and SciPy.
++
++* Corrected a criticial bug in `skbio.alignment.StripedSmithWaterman`/`skbio.alignment.local_pairwise_align_ssw` which would cause the formatting of the aligned sequences to misplace gap characters by the number of gap characters present in the opposing aligned sequence up to that point. This was caused by a faulty implementation of CIGAR string parsing, see [#1679](https://github.com/biocore/scikit-bio/pull/1679) for full details.
+ 
+ * Fixes build errors for newer versions of NumPy, Pandas, and SciPy.
+ 
+diff --git a/skbio/stats/ordination/tests/test_redundancy_analysis.py b/skbio/stats/ordination/tests/test_redundancy_analysis.py
+index 601832f..a8aefe8 100644
+--- a/skbio/stats/ordination/tests/test_redundancy_analysis.py
++++ b/skbio/stats/ordination/tests/test_redundancy_analysis.py
+@@ -245,7 +245,6 @@ class TestRDAResults_biplot_score(TestCase):
+             proportion_explained=vegan_propexpl,
+             eigvals=vegan_eigvals)
+ 
+-        pdt.assert_frame_equal(res_samples, vegan_samples)
+         # This scaling constant is required to make skbio comparable to vegan.
+         scaling = (rda_.eigvals[0] / rda_.eigvals[:6])
+         exp.biplot_scores *= scaling
+diff --git a/skbio/util/_testing.py b/skbio/util/_testing.py
+index ae6ff1f..0d69fbc 100644
+--- a/skbio/util/_testing.py
++++ b/skbio/util/_testing.py
+@@ -12,8 +12,8 @@ import sys
+ 
+ import numpy as np
+ import numpy.testing as npt
+-import pandas.testing as pdt
+-
++import pandas.util.testing as pdt
++from scipy.spatial.distance import pdist
+ from ._decorator import experimental
+ 
+ 
+@@ -118,24 +118,25 @@ def assert_ordination_results_equal(left, right, ignore_method_names=False,
+         npt.assert_equal(left.short_method_name, right.short_method_name)
+         npt.assert_equal(left.long_method_name, right.long_method_name)
+ 
+-    _assert_frame_equal(left.samples, right.samples,
+-                        ignore_columns=ignore_axis_labels,
+-                        ignore_directionality=ignore_directionality,
+-                        decimal=decimal)
+-
+-    _assert_frame_equal(left.features, right.features,
+-                        ignore_columns=ignore_axis_labels,
+-                        ignore_directionality=ignore_directionality,
+-                        decimal=decimal)
+-    _assert_frame_equal(left.biplot_scores, right.biplot_scores,
+-                        ignore_columns=ignore_axis_labels,
+-                        ignore_directionality=ignore_directionality,
+-                        decimal=decimal)
+-
+-    _assert_frame_equal(left.sample_constraints, right.sample_constraints,
+-                        ignore_columns=ignore_axis_labels,
+-                        ignore_directionality=ignore_directionality,
+-                        decimal=decimal)
++    _assert_frame_dists_equal(left.samples, right.samples,
++                              ignore_columns=ignore_axis_labels,
++                              ignore_directionality=ignore_directionality,
++                              decimal=decimal)
++
++    _assert_frame_dists_equal(left.features, right.features,
++                              ignore_columns=ignore_axis_labels,
++                              ignore_directionality=ignore_directionality,
++                              decimal=decimal)
++
++    _assert_frame_dists_equal(left.biplot_scores, right.biplot_scores,
++                              ignore_columns=ignore_axis_labels,
++                              ignore_directionality=ignore_directionality,
++                              decimal=decimal)
++
++    _assert_frame_dists_equal(left.sample_constraints, right.sample_constraints,
++                              ignore_columns=ignore_axis_labels,
++                              ignore_directionality=ignore_directionality,
++                              decimal=decimal)
+ 
+     _assert_series_equal(left.eigvals, right.eigvals, ignore_axis_labels,
+                          decimal=decimal)
+@@ -156,6 +157,24 @@ def _assert_series_equal(left_s, right_s, ignore_index=False, decimal=7):
+             pdt.assert_index_equal(left_s.index, right_s.index)
+ 
+ 
++def _assert_frame_dists_equal(left_df, right_df, ignore_index=False,
++                              ignore_columns=False,
++                              ignore_directionality=False, decimal=7):
++    if left_df is None or right_df is None:
++        assert left_df is None and right_df is None
++    else:
++        left_values = left_df.values
++        right_values = right_df.values
++        left_dists = pdist(left_values)
++        right_dists = pdist(right_values)
++        npt.assert_almost_equal(left_dists, right_dists, decimal=decimal)
++
++        if not ignore_index:
++            pdt.assert_index_equal(left_df.index, right_df.index)
++        if not ignore_columns:
++            pdt.assert_index_equal(left_df.columns, right_df.columns)
++
++
+ def _assert_frame_equal(left_df, right_df, ignore_index=False,
+                         ignore_columns=False, ignore_directionality=False,
+                         decimal=7):


=====================================
debian/patches/pandas1.1-valueerror.patch
=====================================
@@ -0,0 +1,32 @@
+From: Stefano Rivera <stefanor at debian.org>
+Date: Tue, 20 Oct 2020 10:43:09 -0700
+Subject: Update ValueError message assertion check
+
+Fixes compatibility with Pandas 1.1.
+
+Origin: https://github.com/biocore/scikit-bio/pull/1719
+Author: Ritik Raina <rraina at ucsd.edu>
+Bug-Debian: https://bugs.debian.org/972548
+---
+ skbio/metadata/_testing.py | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/skbio/metadata/_testing.py b/skbio/metadata/_testing.py
+index 42ed277..c413133 100644
+--- a/skbio/metadata/_testing.py
++++ b/skbio/metadata/_testing.py
+@@ -715,9 +715,12 @@ class PositionalMetadataMixinTests:
+         # array-like objects will fail if wrong size.
+         for array_like in (np.array(range(length-1)), range(length-1),
+                            np.array(range(length+1)), range(length+1)):
++
+             with self.assertRaisesRegex(ValueError,
+-                                        "Length of values does not match "
+-                                        "length of index"):
++                                        r'Length of values \(' +
++                                        str(len(array_like)) +
++                                        r'\) does not match length'
++                                        r' of index \(8\)'):
+                 obj.positional_metadata['bar'] = array_like
+ 
+     def test_positional_metadata_setter_pandas_consumable(self):


=====================================
debian/patches/series
=====================================
@@ -4,3 +4,5 @@ no_privacy_breach_logo.patch
 ignore_failing_patches.patch
 simde
 soften_test
+pandas1.1-ordination-fix.patch
+pandas1.1-valueerror.patch



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

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-skbio/-/commit/f5e1538c9faaed5cc2cd757be42e31414e8cc6a4
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/20201021/ae59e95b/attachment-0001.html>


More information about the debian-med-commit mailing list