[med-svn] [Git][med-team/python-skbio][master] 3 commits: Fix some more numpy issues

Andreas Tille (@tille) gitlab at salsa.debian.org
Sun Jan 29 18:08:32 GMT 2023



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


Commits:
27b8db6f by Andreas Tille at 2023-01-29T17:30:49+01:00
Fix some more numpy issues

- - - - -
b2462a75 by Andreas Tille at 2023-01-29T19:07:48+01:00
Temporary unavailable python-scipy-doc

- - - - -
ab3e3d2c by Andreas Tille at 2023-01-29T19:08:12+01:00
More numpy issues

- - - - -


2 changed files:

- debian/control
- debian/patches/numpy-1.24.patch


Changes:

=====================================
debian/control
=====================================
@@ -28,7 +28,7 @@ Build-Depends-Arch: python3-lockfile <!nocheck>,
 Build-Depends-Indep: python3-sphinx <!nodoc>,
                      python3-sphinx-bootstrap-theme <!nodoc>,
                      python3-doc <!nodoc>,
-                     python-scipy-doc <!nodoc>,
+#                     python-scipy-doc <!nodoc>,
                      python-biom-format-doc <!nodoc>,
                      python-pandas-doc <!nodoc>
 Standards-Version: 4.6.2


=====================================
debian/patches/numpy-1.24.patch
=====================================
@@ -58,3 +58,72 @@ Forwarded: https://github.com/biocore/scikit-bio/issues/1839
      except ValueError:
          raise QUALFormatError(
              "Could not convert quality scores to integers:\n%s"
+--- a/skbio/metadata/_testing.py
++++ b/skbio/metadata/_testing.py
+@@ -457,7 +457,7 @@ class PositionalMetadataMixinTests:
+ 
+     def test_eq_from_different_source(self):
+         obj1 = self._positional_metadata_constructor_(
+-            3, positional_metadata={'foo': np.array([1, 2, 3])})
++            3, positional_metadata={'foo': np.array([1, 2, 3], dtype=np.int64)})
+         obj2 = self._positional_metadata_constructor_(
+             3, positional_metadata=pd.DataFrame({'foo': [1, 2, 3]},
+                                                 index=['foo', 'bar', 'baz']))
+--- a/skbio/alignment/tests/test_tabular_msa.py
++++ b/skbio/alignment/tests/test_tabular_msa.py
+@@ -1661,7 +1661,7 @@ class TestILoc(SharedPropertyIndexTests,
+                          TabularMSA([a[0:0], b[0:0], c[0:0]],
+                                     metadata={3: 3},
+                                     positional_metadata={3: np.array(
+-                                        [], dtype=int)}))
++                                        [], dtype=np.int64)}))
+ 
+     def test_fancy_empty_both_axes(self):
+         a = DNA("ACGT", metadata={0: 0}, positional_metadata={0: [1, 2, 3, 4]})
+--- a/skbio/stats/_subsample.py
++++ b/skbio/stats/_subsample.py
+@@ -226,7 +226,7 @@ def subsample_counts(counts, n, replace=
+         raise ValueError("n cannot be negative.")
+ 
+     counts = np.asarray(counts)
+-    counts = counts.astype(int, casting='safe')
++    counts = counts.astype(np.int64, casting='safe')
+ 
+     if counts.ndim != 1:
+         raise ValueError("Only 1-D vectors are supported.")
+--- a/skbio/diversity/tests/test_driver.py
++++ b/skbio/diversity/tests/test_driver.py
+@@ -157,7 +157,7 @@ class AlphaDiversityTests(TestCase):
+ 
+     def test_empty(self):
+         # empty vector
+-        actual = alpha_diversity('observed_otus', np.array([], dtype=np.int64))
++        actual = alpha_diversity('observed_otus', np.array([], dtype=np.int32))
+         expected = pd.Series([0])
+         assert_series_almost_equal(actual, expected)
+ 
+@@ -194,11 +194,11 @@ class AlphaDiversityTests(TestCase):
+         assert_series_almost_equal(actual, expected)
+ 
+     def test_single_count_vector(self):
+-        actual = alpha_diversity('observed_otus', np.array([1, 0, 2]))
++        actual = alpha_diversity('observed_otus', np.array([1, 0, 2], np.int32))
+         expected = pd.Series([2])
+         assert_series_almost_equal(actual, expected)
+ 
+-        actual = alpha_diversity('faith_pd', np.array([1, 3, 0, 1, 0]),
++        actual = alpha_diversity('faith_pd', np.array([1, 3, 0, 1, 0], np.int32),
+                                  tree=self.tree1, otu_ids=self.oids1)
+         self.assertAlmostEqual(actual[0], 4.5)
+ 
+@@ -252,6 +252,10 @@ class AlphaDiversityTests(TestCase):
+     def test_no_ids(self):
+         # expected values hand-calculated
+         expected = pd.Series([3, 3, 3, 3])
++        # All this does not help
++        # expected = pd.Series(np.array([3, 3, 3, 3], int32))
++        # actual = np.int64(alpha_diversity('observed_otus', self.table1))
++        # actual = np.dtype('int64').type(alpha_diversity('observed_otus', self.table1))
+         actual = alpha_diversity('observed_otus', self.table1)
+         assert_series_almost_equal(actual, expected)
+ 



View it on GitLab: https://salsa.debian.org/med-team/python-skbio/-/compare/25c2f7dc92b4a683f456bceeb43f8c517a59595c...ab3e3d2cd2247f85503db43b49301d80472fa186

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-skbio/-/compare/25c2f7dc92b4a683f456bceeb43f8c517a59595c...ab3e3d2cd2247f85503db43b49301d80472fa186
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/20230129/32bf460a/attachment-0001.htm>


More information about the debian-med-commit mailing list