Bug#1024044: python-ltfatpy FTBFS with Python 3.11 as supported version
Adrian Bunk
bunk at debian.org
Mon Nov 14 00:30:51 GMT 2022
Source: python-ltfatpy
Version: 1.0.16-7
Severity: serious
Tags: ftbfs
https://buildd.debian.org/status/package.php?p=python-ltfatpy&suite=sid
...
=================================== FAILURES ===================================
________________ TestGabWin.test_composed_dictionnaries_entries ________________
self = <ltfatpy.tests.gabor.test_gabwin.TestGabWin testMethod=test_composed_dictionnaries_entries>
def test_composed_dictionnaries_entries(self):
a = random.randint(10, 40)
M = random.randint(10, 40)
L = lcm(a, M)
# default
self.assertRaises(TypeError, gabwin, {'name': 1}, a, M, L)
# dual psech
tfr = 10
gd = {'name': ('dual', 'sech'), 'tfr': tfr}
mess = "a = {0:d}, M = {1:d}, L = {2:d}".format(a, M, L)
mess += str(gd)
(g, info) = gabwin(gd, a, M, L)
mess += "\ng = " + str(g)
mess += "\ninfo = " + str(info)
self.assertFalse(info['gauss'], mess)
self.assertTrue(info['wasreal'], mess)
self.assertFalse(info['istight'], mess)
self.assertTrue(info['isdual'], mess)
self.assertFalse(info['wasrow'], mess)
self.assertFalse(info['isfir'], mess)
self.assertEqual(info['auxinfo']["tfr"], tfr, mess)
self.assertEqual(info["gl"], len(g), mess)
gt = gabdual(psech(L, tfr)[0], a, M, L)
mess += "\ngt = " + str(gt)
np.testing.assert_array_almost_equal(g, gt, 10, mess)
self.assertRaises(ValueError, gabwin, gd, a, M)
# dual pgauss
tfr = 10
gd = {'name': ('dual',), 'tfr': tfr}
mess = "a = {0:d}, M = {1:d}, L = {2:d}".format(a, M, L)
mess += str(gd)
(g, info) = gabwin(gd, a, M, L)
mess += "\ng = " + str(g)
mess += "\ninfo = " + str(info)
self.assertTrue(info['auxinfo']['gauss'], mess)
self.assertTrue(info['wasreal'], mess)
self.assertFalse(info['istight'], mess)
self.assertTrue(info['isdual'], mess)
self.assertFalse(info['wasrow'], mess)
self.assertFalse(info['isfir'], mess)
self.assertEqual(info['auxinfo']["tfr"], tfr, mess)
self.assertEqual(info["gl"], len(g), mess)
gt = gabdual(pgauss(L, tfr)[0], a, M, L)
mess += "\ngt = " + str(gt)
np.testing.assert_array_almost_equal(g, gt, 10, mess)
self.assertRaises(ValueError, gabwin, gd, a, M)
# dual fir
> name = random.sample(arg_firwin(), 1)[0]
ltfatpy/tests/gabor/test_gabwin.py:356:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <random.Random object at 0x22fd020>
population = {'bartlett', 'blackman', 'blackman2', 'cosine', 'hamming', 'hann', ...}
k = 1
def sample(self, population, k, *, counts=None):
"""Chooses k unique random elements from a population sequence.
Returns a new list containing elements from the population while
leaving the original population unchanged. The resulting list is
in selection order so that all sub-slices will also be valid random
samples. This allows raffle winners (the sample) to be partitioned
into grand prize and second place winners (the subslices).
Members of the population need not be hashable or unique. If the
population contains repeats, then each occurrence is a possible
selection in the sample.
Repeated elements can be specified one at a time or with the optional
counts parameter. For example:
sample(['red', 'blue'], counts=[4, 2], k=5)
is equivalent to:
sample(['red', 'red', 'red', 'red', 'blue', 'blue'], k=5)
To choose a sample from a range of integers, use range() for the
population argument. This is especially fast and space efficient
for sampling from a large population:
sample(range(10000000), 60)
"""
# Sampling without replacement entails tracking either potential
# selections (the pool) in a list or previous selections in a set.
# When the number of selections is small compared to the
# population, then tracking selections is efficient, requiring
# only a small set and an occasional reselection. For
# a larger number of selections, the pool tracking method is
# preferred since the list takes less space than the
# set and it doesn't suffer from frequent reselections.
# The number of calls to _randbelow() is kept at or near k, the
# theoretical minimum. This is important because running time
# is dominated by _randbelow() and because it extracts the
# least entropy from the underlying random number generators.
# Memory requirements are kept to the smaller of a k-length
# set or an n-length list.
# There are other sampling algorithms that do not require
# auxiliary memory, but they were rejected because they made
# too many calls to _randbelow(), making them slower and
# causing them to eat more entropy than necessary.
if not isinstance(population, _Sequence):
> raise TypeError("Population must be a sequence. "
"For dicts or sets, use sorted(d).")
E TypeError: Population must be a sequence. For dicts or sets, use sorted(d).
/usr/lib/python3.11/random.py:436: TypeError
----------------------------- Captured stdout call -----------------------------
Test done
...
=========================== short test summary info ============================
FAILED ltfatpy/tests/gabor/test_gabwin.py::TestGabWin::test_composed_dictionnaries_entries
FAILED ltfatpy/tests/gabor/test_gabwin.py::TestGabWin::test_simple_dictionnaries_entries
FAILED ltfatpy/tests/gabor/test_gabwin.py::TestGabWin::test_str_entries - Typ...
============ 3 failed, 136 passed, 16 warnings in 82.57s (0:01:22) =============
E: pybuild pybuild:379: test: plugin distutils failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.11_ltfatpy/build; python3.11 -m pytest
...
More information about the debian-science-maintainers
mailing list