[Debian-med-packaging] Bug#1079956: neo: Tests fail with python-quantities 0.16.0
Yogeswaran Umasankar
yogu at debian.org
Thu Aug 29 05:18:14 BST 2024
Source: neo
Version: 0.13.2-1
Severity: normal
X-Debbugs-Cc: yogu at debian.org
Dear Maintainer,
neo is failing tests with python-quantities 0.16.0 in sid.
Part of the error looks like
160s =================================== FAILURES ===================================
160s __ TestAnalogSignalConstructor.test__create_with_copy_true_should_return_copy __
160s
160s self = <neo.test.coretest.test_analogsignal.TestAnalogSignalConstructor testMethod=test__create_with_copy_true_should_return_copy>
160s
160s def test__create_with_copy_true_should_return_copy(self):
160s data = np.arange(10.0) * pq.mV
160s rate = 5000 * pq.Hz
160s signal = AnalogSignal(data, copy=True, sampling_rate=rate)
160s data[3] = 99 * pq.mV
160s assert_neo_object_is_compliant(signal)
160s > self.assertNotEqual(signal[3, 0], 99 * pq.mV)
160s E AssertionError: array(99.) * mV == array(99.) * mV
160s
160s neo/test/coretest/test_analogsignal.py:140: AssertionError
160s ___________________ TestAnalogSignalCombination.test__merge ____________________
160s
160s self = <neo.test.coretest.test_analogsignal.TestAnalogSignalCombination testMethod=test__merge>
160s
160s def test__merge(self):
160s self.signal1.description = None
160s self.signal1.file_origin = None
160s assert_neo_object_is_compliant(self.signal1)
160s
160s data3 = np.arange(1000.0, 1066.0).reshape((11, 6)) * pq.uV
160s data3scale = data3.rescale(self.data1quant.units)
160s arr_ann3 = {"anno1": np.arange(5, 11), "anno3": ["h", "i", "j", "k", "l", "m"]}
160s arr_ann4 = {"anno1": np.arange(100, 106), "anno3": ["o", "p", "q", "r", "s", "t"]}
160s
160s signal2 = AnalogSignal(
160s self.data1quant,
160s sampling_rate=1 * pq.kHz,
160s name="signal2",
160s description="test signal",
160s file_origin="testfile.txt",
160s array_annotations=self.arr_ann1,
160s )
160s signal3 = AnalogSignal(
160s data3,
160s units="uV",
160s sampling_rate=1 * pq.kHz,
160s name="signal3",
160s description="test signal",
160s file_origin="testfile.txt",
160s array_annotations=arr_ann3,
160s )
160s signal4 = AnalogSignal(
160s data3,
160s units="uV",
160s sampling_rate=1 * pq.kHz,
160s name="signal4",
160s description="test signal",
160s file_origin="testfile.txt",
160s array_annotations=arr_ann4,
160s )
160s
160s with warnings.catch_warnings(record=True) as w:
160s warnings.filterwarnings("always")
160s merged13 = self.signal1.merge(signal3)
160s merged23 = signal2.merge(signal3)
160s merged24 = signal2.merge(signal4)
160s
160s > self.assertTrue(len(w) == 3)
160s E AssertionError: False is not true
160s
160s neo/test/coretest/test_analogsignal.py:1523: AssertionError
160s __ TestIrregularlySampledSignalArrayMethods.test__time_shift_different_units ___
160s
160s self = <neo.test.coretest.test_irregularysampledsignal.TestIrregularlySampledSignalArrayMethods testMethod=test__time_shift_different_units>
160s
160s def test__time_shift_different_units(self):
160s shifted = self.signal1.time_shift(1 * pq.s)
160s > assert_arrays_equal(shifted.times, self.signal1.times + 1000 * pq.ms)
160s
160s neo/test/coretest/test_irregularysampledsignal.py:696:
160s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
160s
160s a = array([ 1010. , 1027.82559402, 1077.42636827, 1215.443469 ,
160s 1599.48425032, 2668.1005372 , 5641.58883361, 13915.49665015,
160s 36938.13663805, 101000. ]) * ms
160s b = array([ 2010. , 2027.82559402, 2077.42636827, 2215.443469 ,
160s 2599.48425032, 3668.1005372 , 6641.58883361, 14915.49665015,
160s 37938.13663805, 102000. ]) * ms
160s dtype = False
160s
160s def assert_arrays_equal(a, b, dtype=False):
160s """
160s Check if two arrays have the same shape and contents.
160s
160s If dtype is True (default=False), then also theck that they have the same
160s dtype.
160s """
160s assert isinstance(a, np.ndarray), f"a is a {type(a)}"
160s assert isinstance(b, np.ndarray), f"b is a {type(b)}"
160s assert a.shape == b.shape, f"{a} != {b}"
160s # assert a.dtype == b.dtype, "%s and %s not same dtype %s %s" % (a, b,
160s # a.dtype,
160s # b.dtype)
160s try:
160s > assert (a.flatten() == b.flatten()).all(), f"{a} != {b}"
160s E AssertionError: [ 1010. 1027.82559402 1077.42636827 1215.443469
160s E 1599.48425032 2668.1005372 5641.58883361 13915.49665015
160s E 36938.13663805 101000. ] ms != [ 2010. 2027.82559402 2077.42636827 2215.443469
160s E 2599.48425032 3668.1005372 6641.58883361 14915.49665015
160s E 37938.13663805 102000. ] ms
160s
160s neo/test/tools.py:35: AssertionError
Full log at
https://ci.debian.net/packages/n/neo/testing/arm64/51068351/
More information about the Debian-med-packaging
mailing list