[Debian-med-packaging] Bug#1029452: python-skbio: (autopkgtest) needs update for NumPy 1.24

Graham Inggs ginggs at debian.org
Sun Jan 22 19:15:56 GMT 2023


Source: python-skbio
Version: 0.5.8-1
Severity: serious
User: debian-ci at lists.debian.org
Usertags: needs-update

Hi Maintainer

The autopkgtests of python-skbio fail with NumPy 1.24 [1].  I've
copied what I hope is the relevant part of the log below.

Regards
Graham


[1] https://ci.debian.net/packages/p/python-skbio/testing/amd64/


=================================== FAILURES ===================================
___________________ TestLoc.test_multiindex_complicated_axis ___________________

self = <skbio.alignment.tests.test_tabular_msa.TestLoc
testMethod=test_multiindex_complicated_axis>

    def test_multiindex_complicated_axis(self):
        a = RNA("UUAG", metadata={0: 0}, positional_metadata={0: [1, 2, 3, 4]})
        b = RNA("UAAG", metadata={1: 0}, positional_metadata={1: [1, 2, 3, 4]})
        c = RNA("UAA-", metadata={2: 0}, positional_metadata={2: [1, 2, 3, 4]})
        d = RNA("UA-G", metadata={3: 0}, positional_metadata={3: [1, 2, 3, 4]})
        msa = TabularMSA([a, b, c, d], metadata={'x': 'y'},
                         positional_metadata={'c': ['a', 'b', 'c', 'd']},
                         index=[('a', 'x', 0), ('a', 'x', 1), ('a', 'y', 2),
                                ('b', 'x', 0)])

>       self.assertEqual(self.get(msa, (([False, True, False, True],
                                         'x', 0), Ellipsis)),
                         TabularMSA([d], metadata={'x': 'y'},
                                    positional_metadata={'c': ['a', 'b', 'c',
                                                               'd']},
                                    index=[('b', 'x', 0)]))

skbio/alignment/tests/test_tabular_msa.py:1373:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
skbio/alignment/tests/test_tabular_msa.py:1271: in get
    return obj.loc[indexable]
skbio/alignment/_indexing.py:39: in __getitem__
    return self._handle_both_axes(*indexable)
skbio/alignment/_indexing.py:53: in _handle_both_axes
    r = self._slice_on_first_axis(self._obj, seq_index)
skbio/alignment/_indexing.py:77: in _slice_on_first_axis
    return self._slice_sequences(obj, indexable)
skbio/alignment/_indexing.py:202: in _slice_sequences
    self._assert_bool_vector_right_size(indexable, axis=0)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <skbio.alignment._indexing.TabularMSALoc object at 0x7f9cc59ece80>
indexable = ([False, True, False, True], 'x', 0), axis = 0

    def _assert_bool_vector_right_size(self, indexable, axis):
        if isinstance(indexable, np.ndarray):
            pass
        elif hasattr(indexable, '__iter__'):
>           indexable = np.asarray(list(indexable))
E           ValueError: setting an array element with a sequence. The
requested array has an inhomogeneous shape after 1 dimensions. The
detected shape was (3,) + inhomogeneous part.

skbio/alignment/_indexing.py:116: ValueError
___________ TestLoc.test_multiindex_complicated_axis_empty_selection ___________

self = <skbio.alignment.tests.test_tabular_msa.TestLoc
testMethod=test_multiindex_complicated_axis_empty_selection>

    @unittest.skipIf(tuple(map(int, pd.__version__.split('.'))) < (1, 2, 5),
                     "Old pandas will return empty frame")
    def test_multiindex_complicated_axis_empty_selection(self):
        a = RNA("UUAG", metadata={0: 0}, positional_metadata={0: [1, 2, 3, 4]})
        b = RNA("UAAG", metadata={1: 0}, positional_metadata={1: [1, 2, 3, 4]})
        c = RNA("UAA-", metadata={2: 0}, positional_metadata={2: [1, 2, 3, 4]})
        d = RNA("UA-G", metadata={3: 0}, positional_metadata={3: [1, 2, 3, 4]})
        msa = TabularMSA([a, b, c, d], metadata={'x': 'y'},
                         positional_metadata={'c': ['a', 'b', 'c', 'd']},
                         index=[('a', 'x', 0), ('a', 'x', 1), ('a', 'y', 2),
                                ('b', 'x', 0)])
        # Pandas will KeyError when the intersection is empty
        # change appears to have happened in:
        # https://github.com/pandas-dev/pandas/pull/42245
        # but this was not bisected to confirm
        with self.assertRaises(KeyError):
>           self.get(msa, (([False, True, False, True], 'x', 2), Ellipsis))

skbio/alignment/tests/test_tabular_msa.py:1396:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
skbio/alignment/tests/test_tabular_msa.py:1271: in get
    return obj.loc[indexable]
skbio/alignment/_indexing.py:39: in __getitem__
    return self._handle_both_axes(*indexable)
skbio/alignment/_indexing.py:53: in _handle_both_axes
    r = self._slice_on_first_axis(self._obj, seq_index)
skbio/alignment/_indexing.py:77: in _slice_on_first_axis
    return self._slice_sequences(obj, indexable)
skbio/alignment/_indexing.py:202: in _slice_sequences
    self._assert_bool_vector_right_size(indexable, axis=0)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def _assert_bool_vector_right_size(self, indexable, axis):
        if isinstance(indexable, np.ndarray):
            pass
        elif hasattr(indexable, '__iter__'):
>           indexable = np.asarray(list(indexable))
E           ValueError: setting an array element with a sequence. The
requested array has an inhomogeneous shape after 1 dimensions. The
detected shape was (3,) + inhomogeneous part.

skbio/alignment/_indexing.py:116: ValueError
___________________ TestSequence.test_init_invalid_sequence ____________________

self = <skbio.sequence.tests.test_sequence.TestSequence
testMethod=test_init_invalid_sequence>

    def test_init_invalid_sequence(self):
        # invalid dtype (numpy.ndarray input)
        with self.assertRaises(TypeError):
            # int64
            Sequence(np.array([1, 2, 3]))
        with self.assertRaises(TypeError):
            # |S21
            Sequence(np.array([1, "23", 3]))
        with self.assertRaises(TypeError):
            # object
>           Sequence(np.array([1, {}, ()]))
E           ValueError: setting an array element with a sequence. The
requested array has an inhomogeneous shape after 1 dimensions. The
detected shape was (3,) + inhomogeneous part.

skbio/sequence/tests/test_sequence.py:462: ValueError
____________ TestSequence.test_munge_to_index_array_valid_iterable _____________

self = <skbio.sequence.tests.test_sequence.TestSequence
testMethod=test_munge_to_index_array_valid_iterable>

    def test_munge_to_index_array_valid_iterable(self):
        s = Sequence('')

        def slices_only():
            return (slice(i, i+1) for i in range(0, 10, 2))

        def mixed():
            return (slice(i, i+1) if i % 2 == 0 else i for i in range(10))

        def unthinkable():
            for i in range(10):
                if i % 3 == 0:
                    yield slice(i, i+1)
                elif i % 3 == 1:
                    yield i
                else:
                    yield np.array([i], dtype=int)
        for c in (lambda x: x, list, tuple, lambda x: np.array(tuple(x)),
                  lambda x: pd.Series(tuple(x))):
            exp = np.arange(10, dtype=int)
            obs = s._munge_to_index_array(c(mixed()))
            npt.assert_equal(obs, exp)

            exp = np.arange(10, dtype=int)
>           obs = s._munge_to_index_array(c(unthinkable()))

skbio/sequence/tests/test_sequence.py:2222:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

x = <generator object
TestSequence.test_munge_to_index_array_valid_iterable.<locals>.unthinkable
at 0x7f9cb7346420>

>   for c in (lambda x: x, list, tuple, lambda x: np.array(tuple(x)),
              lambda x: pd.Series(tuple(x))):
E             ValueError: setting an array element with a sequence.
The requested array has an inhomogeneous shape after 1 dimensions. The
detected shape was (10,) + inhomogeneous part.

skbio/sequence/tests/test_sequence.py:2215: ValueError



More information about the Debian-med-packaging mailing list