[med-svn] [Git][med-team/python-skbio][master] Add hack to get tests passing with np 1.24
Nilesh Patra (@nilesh)
gitlab at salsa.debian.org
Wed Jan 25 15:26:15 GMT 2023
Nilesh Patra pushed to branch master at Debian Med / python-skbio
Commits:
a83d97b4 by Nilesh Patra at 2023-01-25T20:55:34+05:30
Add hack to get tests passing with np 1.24
- - - - -
2 changed files:
- + debian/patches/numpy-1.24.patch
- debian/patches/series
Changes:
=====================================
debian/patches/numpy-1.24.patch
=====================================
@@ -0,0 +1,34 @@
+--- a/skbio/alignment/_indexing.py
++++ b/skbio/alignment/_indexing.py
+@@ -113,7 +113,10 @@
+ if isinstance(indexable, np.ndarray):
+ pass
+ elif hasattr(indexable, '__iter__'):
+- indexable = np.asarray(list(indexable))
++ try:
++ indexable = np.asarray(list(indexable))
++ except:
++ indexable = np.asarray(list(indexable), dtype='object')
+ else:
+ return indexable
+
+--- a/skbio/sequence/tests/test_sequence.py
++++ b/skbio/sequence/tests/test_sequence.py
+@@ -459,7 +459,7 @@
+ Sequence(np.array([1, "23", 3]))
+ with self.assertRaises(TypeError):
+ # object
+- Sequence(np.array([1, {}, ()]))
++ Sequence(np.array([1, {}, ()], dtype='object'))
+
+ # invalid input type (non-numpy.ndarray input)
+ with self.assertRaisesRegex(TypeError, r'tuple'):
+@@ -2212,7 +2212,7 @@
+ yield i
+ else:
+ yield np.array([i], dtype=int)
+- for c in (lambda x: x, list, tuple, lambda x: np.array(tuple(x)),
++ for c in (lambda x: x, list, tuple, lambda x: np.array(tuple(x), dtype='object'),
+ lambda x: pd.Series(tuple(x))):
+ exp = np.arange(10, dtype=int)
+ obs = s._munge_to_index_array(c(mixed()))
=====================================
debian/patches/series
=====================================
@@ -4,3 +4,4 @@ no_privacy_breach_logo.patch
local_inventory
older-scipy.patch
modify-test.patch
+numpy-1.24.patch
View it on GitLab: https://salsa.debian.org/med-team/python-skbio/-/commit/a83d97b4c1f37e3bb59df123d42fc4c1a4d07bf0
--
View it on GitLab: https://salsa.debian.org/med-team/python-skbio/-/commit/a83d97b4c1f37e3bb59df123d42fc4c1a4d07bf0
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/20230125/a1c19c51/attachment-0001.htm>
More information about the debian-med-commit
mailing list