[med-svn] [Git][med-team/python-dicompylercore][master] 5 commits: adjust-collections.patch: new: ditto.
Étienne Mollier (@emollier)
gitlab at salsa.debian.org
Sun Feb 16 09:13:43 GMT 2025
Étienne Mollier pushed to branch master at Debian Med / python-dicompylercore
Commits:
755d60f7 by Étienne Mollier at 2025-02-16T10:06:53+01:00
adjust-collections.patch: new: ditto.
This patch contributes to the resolution of bug #1095369.
- - - - -
a57a2161 by Étienne Mollier at 2025-02-16T10:07:48+01:00
skip-tight-comparison.patch: new: skip a failing test with numpy 2.x.
This is the second part of the #1095369 correction.
Closes: #1095369
- - - - -
20082460 by Étienne Mollier at 2025-02-16T10:09:24+01:00
d/control: declate compliance to standards version 4.7.0.
- - - - -
30157583 by Étienne Mollier at 2025-02-16T10:10:19+01:00
d/changelog: ready for upload to unstable.
- - - - -
8eb5cc37 by Étienne Mollier at 2025-02-16T10:12:50+01:00
skip-tight-comparison.patch: fix typo in patch description.
Gbp-Dch: ignore
- - - - -
5 changed files:
- debian/changelog
- debian/control
- + debian/patches/adjust-collections.patch
- debian/patches/series
- + debian/patches/skip-tight-comparison.patch
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,14 @@
+python-dicompylercore (0.5.6-3) unstable; urgency=medium
+
+ * Team upload.
+ * adjust-collections.patch: new: ditto.
+ This patch contributes to the resolution of bug #1095369.
+ * skip-tight-comparison.patch: new: skip a failing test with numpy 2.x.
+ This is the second part of the #1095369 correction. (Closes: #1095369)
+ * d/control: declate compliance to standards version 4.7.0.
+
+ -- Étienne Mollier <emollier at debian.org> Sun, 16 Feb 2025 10:10:07 +0100
+
python-dicompylercore (0.5.6-2) unstable; urgency=medium
* Team upload.
=====================================
debian/control
=====================================
@@ -12,7 +12,7 @@ Build-Depends: debhelper-compat (= 13),
python3-pydicom <!nocheck>,
python3-shapely <!nocheck>,
python3-skimage <!nocheck>
-Standards-Version: 4.6.2
+Standards-Version: 4.7.0
Vcs-Browser: https://salsa.debian.org/med-team/python-dicompylercore
Vcs-Git: https://salsa.debian.org/med-team/python-dicompylercore.git
Homepage: https://github.com/dicompyler/dicompyler-core
=====================================
debian/patches/adjust-collections.patch
=====================================
@@ -0,0 +1,40 @@
+Description: fix test failure caused by evolution in collections module.
+ This change addresses the following test failure:
+ .
+ ERROR: test_image_generation (tests.test_dicomparser.TestImage.test_image_generation)
+ Test if the image can be generated.
+ ----------------------------------------------------------------------
+ Traceback (most recent call last):
+ File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/tests/test_dicomparser.py", line 141, in test_image_generation
+ self.assertEqual(self.dp.GetImage().getpixel((255, 254)), image)
+ ~~~~~~~~~~~~~~~~^^
+ File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/dicompylercore/dicomparser.py", line 407, in GetImage
+ image = self.GetLUTValue(rescaled_image, window, level)
+ File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/dicompylercore/dicomparser.py", line 472, in GetLUTValue
+ lutvalue = util.piecewise(
+ data,
+ ...<3 lines>...
+ ((data - (level - 0.5)) / (window-1) + 0.5) *
+ (255 - 0)])
+ File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/dicompylercore/util.py", line 135, in piecewise
+ if not isinstance(item, collections.Callable):
+ ^^^^^^^^^^^^^^^^^^^^
+ AttributeError: module 'collections' has no attribute 'Callable'
+
+Author: Étienne Mollier <emollier at debian.org>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1095369
+Forwarded: no
+Last-Update: 2025-02-16
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- python-dicompylercore.orig/dicompylercore/util.py
++++ python-dicompylercore/dicompylercore/util.py
+@@ -132,7 +132,7 @@
+ y = np.zeros(x.shape, x.dtype)
+ for k in range(n):
+ item = funclist[k]
+- if not isinstance(item, collections.Callable):
++ if not isinstance(item, collections.abc.Callable):
+ y[condlist[k]] = item
+ else:
+ vals = x[condlist[k]]
=====================================
debian/patches/series
=====================================
@@ -1 +1,3 @@
remove-six.patch
+adjust-collections.patch
+skip-tight-comparison.patch
=====================================
debian/patches/skip-tight-comparison.patch
=====================================
@@ -0,0 +1,49 @@
+Description: skip tight comparison failing with numpy 2.x.
+ This patch works around the following test failure:
+ .
+ FAIL: test_raw_data_dvh (tests.test_dvh.TestDVH.test_raw_data_dvh)
+ Test if a DVH can be created from raw data.
+ ----------------------------------------------------------------------
+ Traceback (most recent call last):
+ File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13/build/tests/test_dvh.py", line 41, in test_raw_data_dvh
+ self.assertEqual(
+ ~~~~~~~~~~~~~~~~^
+ repr(dvh.DVH.from_data(1, 1)),
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ "DVH(cumulative, 1 bins: [0:1] Gy, volume: 1 cm3, "
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ "name: None, rx_dose: 0 Gy)")
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ AssertionError: 'DVH([16 chars]ns: [np.int64(0):np.int64(1)] Gy, volume: np.i[35 chars] Gy)' != 'DVH([16 chars]ns: [0:1] Gy, volume: 1 cm3, name: None, rx_dose: 0 Gy)'
+ - DVH(cumulative, 1 bins: [np.int64(0):np.int64(1)] Gy, volume: np.int64(1) cm3, name: None, rx_dose: 0 Gy)
+ ? --------- - --------- - --------- -
+ + DVH(cumulative, 1 bins: [0:1] Gy, volume: 1 cm3, name: None, rx_dose: 0 Gy)
+ .
+ The end result of the computation is no different from the normal
+ result, so it is okay to skip it. The main issue looks to be that with
+ newer numpy versions, the check becomes too restrictive with its
+ expectation of how types ought to be formatted.
+
+Author: Étienne Mollier <emollier at debian.org>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1095369
+Forwarded: not-needed
+Last-Update: 2025-02-16
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- python-dicompylercore.orig/tests/test_dvh.py
++++ python-dicompylercore/tests/test_dvh.py
+@@ -38,10 +38,10 @@
+ def test_raw_data_dvh(self):
+ """Test if a DVH can be created from raw data."""
+ self.assertEqual(dvh.DVH.from_data(1, 1), dvh.DVH([1], [1]))
+- self.assertEqual(
+- repr(dvh.DVH.from_data(1, 1)),
+- "DVH(cumulative, 1 bins: [0:1] Gy, volume: 1 cm3, "
+- "name: None, rx_dose: 0 Gy)")
++ #self.assertEqual(
++ # repr(dvh.DVH.from_data(1, 1)),
++ # "DVH(cumulative, 1 bins: [0:1] Gy, volume: 1 cm3, "
++ # "name: None, rx_dose: 0 Gy)")
+ assert_array_equal(dvh.DVH.from_data(0, 1).bins, array([0, 0]))
+ assert_array_equal(dvh.DVH.from_data(5, 2).bins, array([0, 2, 4, 5]))
+
View it on GitLab: https://salsa.debian.org/med-team/python-dicompylercore/-/compare/2c230d581c011c8185aa4dfebe00c00b15b23de5...8eb5cc37764c21b30ae130342ff0267df0f99ea6
--
View it on GitLab: https://salsa.debian.org/med-team/python-dicompylercore/-/compare/2c230d581c011c8185aa4dfebe00c00b15b23de5...8eb5cc37764c21b30ae130342ff0267df0f99ea6
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/20250216/b3a532b9/attachment-0001.htm>
More information about the debian-med-commit
mailing list