[med-svn] [Git][med-team/python-dicompylercore][master] 7 commits: d/watch: version=5
Andreas Tille (@tille)
gitlab at salsa.debian.org
Tue Jun 2 18:29:40 BST 2026
Andreas Tille pushed to branch master at Debian Med / python-dicompylercore
Commits:
baa5885f by Andreas Tille at 2026-06-02T18:20:29+02:00
d/watch: version=5
- - - - -
8ff020d5 by Andreas Tille at 2026-06-02T18:41:04+02:00
Upstream patch to update pydicom Python 3.10+ Closes: #1136924
- - - - -
331993e1 by Andreas Tille at 2026-06-02T18:41:41+02:00
Standards-Version: 4.7.4 (routine-update)
- - - - -
8fde110c by Andreas Tille at 2026-06-02T19:10:02+02:00
Changes made by cme
- - - - -
8ce604d6 by Andreas Tille at 2026-06-02T19:10:03+02:00
Build-Depends: s/dh-python/dh-sequence-python3/ (routine-update)
- - - - -
bf3e85f9 by Andreas Tille at 2026-06-02T19:10:03+02:00
Drop 'Rules-Requires-Root: no' from d/control (routine-update)
- - - - -
858b3f6f by Andreas Tille at 2026-06-02T19:11:14+02:00
routine-update: Ready to upload to unstable
- - - - -
6 changed files:
- debian/changelog
- debian/control
- + debian/patches/0d5729d7a2412e1c3f1e4cb4f6b07f7407eb8b06.patch
- debian/patches/series
- debian/rules
- debian/watch
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,16 @@
+python-dicompylercore (0.5.6-4) unstable; urgency=medium
+
+ * d/watch: version=5
+ * Upstream patch to update pydicom Python 3.10+
+ Closes: #1136924
+ * Standards-Version: 4.7.4 (routine-update)
+ * Reflow Uploaders field (cme)
+ * Remove Priority field (cme)
+ * Build-Depends: s/dh-python/dh-sequence-python3/ (routine-update)
+ * Drop 'Rules-Requires-Root: no' from d/control (routine-update)
+
+ -- Andreas Tille <tille at debian.org> Tue, 02 Jun 2026 19:10:11 +0200
+
python-dicompylercore (0.5.6-3) unstable; urgency=medium
* Team upload.
=====================================
debian/control
=====================================
@@ -1,35 +1,36 @@
Source: python-dicompylercore
+Standards-Version: 4.7.4
+Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
+Uploaders:
+ Andreas Tille <tille at debian.org>,
Section: python
Testsuite: autopkgtest-pkg-python
-Priority: optional
-Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
-Uploaders: Andreas Tille <tille at debian.org>
-Build-Depends: debhelper-compat (= 13),
- dh-python,
- python3,
- python3-setuptools,
- python3-matplotlib <!nocheck>,
- python3-pydicom <!nocheck>,
- python3-shapely <!nocheck>,
- python3-skimage <!nocheck>
-Standards-Version: 4.7.0
+Build-Depends:
+ debhelper-compat (= 13),
+ dh-sequence-python3,
+ python3,
+ python3-setuptools,
+ python3-matplotlib <!nocheck>,
+ python3-pydicom <!nocheck>,
+ python3-shapely <!nocheck>,
+ python3-skimage <!nocheck>,
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
-Rules-Requires-Root: no
Package: python3-dicompylercore
Architecture: any
-Depends: ${python3:Depends},
- ${shlibs:Depends},
- ${misc:Depends},
- python3-numpy,
- python3-pydicom,
- python3-matplotlib,
- python3-six,
- python3-pil,
- python3-shapely,
- python3-skimage
+Depends:
+ ${python3:Depends},
+ ${shlibs:Depends},
+ ${misc:Depends},
+ python3-numpy,
+ python3-pydicom,
+ python3-matplotlib,
+ python3-six,
+ python3-pil,
+ python3-shapely,
+ python3-skimage,
Description: core radiation therapy modules for DICOM / DICOM RT used by dicompyler
This package provides a Python3 library of core radiation therapy
modules for DICOM / DICOM RT used by dicompyler. It includes:
=====================================
debian/patches/0d5729d7a2412e1c3f1e4cb4f6b07f7407eb8b06.patch
=====================================
@@ -0,0 +1,409 @@
+From 0d5729d7a2412e1c3f1e4cb4f6b07f7407eb8b06 Mon Sep 17 00:00:00 2001
+From: Aditya Panchal <apanchal at bastula.org>
+Date: Fri, 10 Jan 2025 09:23:23 -0600
+Subject: [PATCH] Update to work with pydicom 2.4+, 3.X, Python 3.10+ (#384)
+Bug-Debian: https://bugs.debian.org/1136924
+
+* Update pydicom supported to >=2.4..0
+* fix DVH repr problems with 'np.int(...) repr'
+* collections.Callable -> collections.abc.Callable
+
+* Resolve fixing of file_meta info
+
+* Update workflows for testing pydicom 2.4, 3.X
+* update some of the actions script versions
+
+* Fix style and import issues
+
+* Fix syntax
+
+* Update Python versions in setup.py
+* make pydicom versions in build name more obvious
+
+* Fix force of old pydicom
+
+* Update README to reflect Python 3.10 compatibility and badge changes
+
+---------
+
+Co-authored-by: Darcy Mason <darcymason at gmail.com>
+---
+ .github/workflows/build.yml | 18 ++++++---
+ .github/workflows/codacy.yml | 2 +-
+ .github/workflows/codeql.yml | 2 +-
+ .github/workflows/dependency-review.yml | 4 +-
+ HISTORY.rst | 1 +
+ README.rst | 10 ++---
+ dicompylercore/dicomparser.py | 53 ++++++++++++++++++++-----
+ dicompylercore/dvh.py | 18 ++++-----
+ dicompylercore/util.py | 2 +-
+ docs/conf.py | 2 +-
+ setup.py | 9 ++---
+ tests/test_dicomparser.py | 12 ++----
+ tests/test_dose.py | 11 +----
+ tests/test_dvhcalc.py | 14 +++----
+ 14 files changed, 91 insertions(+), 67 deletions(-)
+
+--- a/.github/workflows/build.yml
++++ b/.github/workflows/build.yml
+@@ -13,19 +13,22 @@ jobs:
+ strategy:
+ fail-fast: false
+ matrix:
+- python-version: ["3.7", "3.8", "3.9", "3.10"]
+-
++ python-version: ["3.10", "3.11", "3.12", "3.13"]
++ pydicom-version: ["pydicom-latest"]
++ include:
++ - python-version: "3.10"
++ pydicom-version: "pydicom==2.4.0"
+ steps:
+ - name: Checkout repository
+- uses: actions/checkout at v3
++ uses: actions/checkout at v4
+
+ - name: Set up Python ${{ matrix.python-version }}
+- uses: actions/setup-python at v4
++ uses: actions/setup-python at v5
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ - name: Cache Python dependencies
+- uses: actions/cache at v3
++ uses: actions/cache at v4
+ with:
+ path: ~/.cache/pip
+ key: ${{ hashFiles('setup.py') }}
+@@ -37,6 +40,11 @@ jobs:
+ pip install coverage
+ pip install coveralls
+ pip install codecov
++
++ - name: Force pydicom version if needed
++ if: startsWith(matrix.pydicom-version, 'pydicom==')
++ run: |
++ pip install -U "${{ matrix.pydicom-version }}"
+
+ - name: Run tests via coverage
+ run: |
+--- a/.github/workflows/codacy.yml
++++ b/.github/workflows/codacy.yml
+@@ -36,7 +36,7 @@ jobs:
+ steps:
+ # Checkout the repository to the GitHub Actions runner
+ - name: Checkout code
+- uses: actions/checkout at v3
++ uses: actions/checkout at v4
+
+ # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
+ - name: Run Codacy Analysis CLI
+--- a/.github/workflows/codeql.yml
++++ b/.github/workflows/codeql.yml
+@@ -24,7 +24,7 @@ jobs:
+
+ steps:
+ - name: Checkout
+- uses: actions/checkout at v3
++ uses: actions/checkout at v4
+
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init at v2
+--- a/.github/workflows/dependency-review.yml
++++ b/.github/workflows/dependency-review.yml
+@@ -15,6 +15,6 @@ jobs:
+ runs-on: ubuntu-latest
+ steps:
+ - name: 'Checkout Repository'
+- uses: actions/checkout at v3
++ uses: actions/checkout at v4
+ - name: 'Dependency Review'
+- uses: actions/dependency-review-action at v3
++ uses: actions/dependency-review-action at v4
+--- a/HISTORY.rst
++++ b/HISTORY.rst
+@@ -5,6 +5,7 @@ History
+ 0.5.7 (unreleased)
+ ------------------
+ - Dropped support for Python 2.
++- pydicom 3.X supported (requirement now >= pydicom 2.4.0)
+
+ 0.5.6 (2023-05-08)
+ ------------------
+--- a/README.rst
++++ b/README.rst
+@@ -16,13 +16,13 @@ Other information
+
+ - Free software: `BSD license <https://github.com/dicompyler/dicompyler-core/blob/master/LICENSE>`__
+ - Documentation: `Read the docs <https://dicompyler-core.readthedocs.io>`__
+-- Tested on Python 3.7+
++- Tested on Python 3.10+
+
+ Dependencies
+ ------------
+
+ - `numpy <http://www.numpy.org>`__ 1.2 or higher
+-- `pydicom <https://pydicom.github.io>`__ 0.9.9 or higher (pydicom 1.0 compatible)
++- `pydicom <https://pydicom.github.io>`__ 2.4.0 or higher
+ - `matplotlib <http://matplotlib.org>`__ 1.3.0 or higher (for DVH calculation)
+ - Optional:
+
+@@ -85,7 +85,7 @@ This package was created with
+ :target: http://mybinder.org/repo/bastula/dicom-notebooks
+ .. |pypi| image:: https://img.shields.io/pypi/v/dicompyler-core.svg
+ :target: https://pypi.python.org/pypi/dicompyler-core
+-.. |Python Version| image:: https://img.shields.io/badge/python-3.7+-blue.svg
++.. |Python Version| image:: https://img.shields.io/badge/python-3.10+-blue.svg
+ :target: https://pypi.python.org/pypi/dicompyler-core
+ .. |GH Actions| image:: https://github.com/dicompyler/dicompyler-core/actions/workflows/build.yml/badge.svg
+ :target: https://github.com/dicompyler/dicompyler-core/actions
+@@ -97,8 +97,8 @@ This package was created with
+ :target: https://app.codacy.com/gh/dicompyler/dicompyler-core/dashboard
+ .. |Codecov| image:: https://codecov.io/gh/dicompyler/dicompyler-core/branch/master/graph/badge.svg
+ :target: https://codecov.io/gh/dicompyler/dicompyler-core
+-.. |Total Lines| image:: https://img.shields.io/tokei/lines/github/dicompyler/dicompyler-core
+- :target: https://img.shields.io/tokei/lines/github/dicompyler/dicompyler-core
++.. |Total Lines| image:: https://img.shields.io/endpoint?url=https://ghloc.vercel.app/api/dicompyler/dicompyler-core/badge?style=flat&logoColor=white&label=Lines%20of%20Code
++ :target: https://ghloc.vercel.app/dicompyler/dicompyler-core?branch=master
+ .. |Code Size| image:: https://img.shields.io/github/languages/code-size/dicompyler/dicompyler-core
+ :target: https://img.shields.io/github/languages/code-size/dicompyler/dicompyler-core
+ .. |Zenodo| image:: https://zenodo.org/badge/51550203.svg
+--- a/dicompylercore/dicomparser.py
++++ b/dicompylercore/dicomparser.py
+@@ -11,13 +11,10 @@
+
+ import logging
+ import numpy as np
+-try:
+- from pydicom.dicomio import read_file
+- from pydicom.dataset import Dataset, validate_file_meta
+- from pydicom.pixel_data_handlers.util import pixel_dtype
+-except ImportError:
+- from dicom import read_file
+- from dicom.dataset import Dataset
++from pydicom.dicomio import dcmread
++from pydicom.dataset import Dataset, validate_file_meta
++from pydicom.pixel_data_handlers.util import pixel_dtype
++from pydicom.uid import ImplicitVRLittleEndian, ExplicitVRBigEndian
+ import random
+ from numbers import Number
+ from io import BytesIO
+@@ -33,6 +30,40 @@ if shapely_available:
+ logger = logging.getLogger('dicompylercore.dicomparser')
+
+
++def _fix_meta_info(dataset: Dataset) -> None:
++ """Ensure the file meta info exists and has the correct values
++ for transfer syntax and media storage UIDs.
++
++ Copied from pydicom 2.4 and edited
++
++ .. warning::
++
++ The transfer syntax for ``is_implicit_VR = False`` and
++ ``is_little_endian = True`` is ambiguous and will therefore not
++ be set.
++
++ Parameters
++ ----------
++ dataset: pydicom Dataset
++
++ """
++ dataset.ensure_file_meta()
++
++ if dataset.is_little_endian and dataset.is_implicit_VR:
++ dataset.file_meta.TransferSyntaxUID = ImplicitVRLittleEndian
++ elif not dataset.is_little_endian and not dataset.is_implicit_VR:
++ dataset.file_meta.TransferSyntaxUID = ExplicitVRBigEndian
++ elif not dataset.is_little_endian and dataset.is_implicit_VR:
++ raise NotImplementedError(
++ "Implicit VR Big Endian is not a supported Transfer Syntax."
++ )
++
++ if 'SOPClassUID' in dataset:
++ dataset.file_meta.MediaStorageSOPClassUID = dataset.SOPClassUID
++ if 'SOPInstanceUID' in dataset:
++ dataset.file_meta.MediaStorageSOPInstanceUID = dataset.SOPInstanceUID
++
++
+ class DicomParser:
+ """Class to parse DICOM / DICOM RT files."""
+
+@@ -59,7 +90,7 @@ class DicomParser:
+ elif isinstance(dataset, (str, BytesIO, Path)):
+ try:
+ with open(dataset, "rb") as fp:
+- self.ds = read_file(fp, defer_size=100, force=True,
++ self.ds = dcmread(fp, defer_size=100, force=True,
+ stop_before_pixels=memmap_pixel_array)
+ if memmap_pixel_array:
+ self.offset = fp.tell() + 8
+@@ -78,12 +109,14 @@ class DicomParser:
+ raise AttributeError
+
+ # Fix dataset file_meta if incorrect
++ self.ds.ensure_file_meta()
+ try:
+ validate_file_meta(self.ds.file_meta)
+- except ValueError:
++ except (AttributeError, ValueError):
+ logger.debug('Fixing invalid File Meta for ' +
+ str(self.ds.SOPInstanceUID))
+- self.ds.fix_meta_info()
++ _fix_meta_info(self.ds)
++ validate_file_meta(self.ds.file_meta)
+
+ # Remove the PixelData attribute if it is not set.
+ # i.e. RTStruct does not contain PixelData and its presence can confuse
+--- a/dicompylercore/dvh.py
++++ b/dicompylercore/dvh.py
+@@ -108,16 +108,14 @@ class DVH(object):
+
+ def __repr__(self):
+ """String representation of the class."""
+- return 'DVH(%s, %r bins: [%r:%r] %s, volume: %r %s, name: %r, ' \
+- 'rx_dose: %d %s%s)' % \
+- (self.dvh_type, self.counts.size, self.bins.min(),
+- self.bins.max(), self.dose_units,
+- self.volume, self.volume_units,
+- self.name,
+- 0 if not self.rx_dose else self.rx_dose,
+- self.dose_units,
+- ', *Notes: ' + self.notes if self.notes else '')
+-
++ return (
++ f'DVH({self.dvh_type}, {self.counts.size} bins: '
++ f'[{self.bins.min()}:{self.bins.max()}] {self.dose_units}, '
++ f'volume: {self.volume} {self.volume_units}, name: {self.name}, '
++ f'rx_dose: {0 if not self.rx_dose else self.rx_dose} '
++ f'{self.dose_units}'
++ f'{", *Notes: " + self.notes if self.notes else ""})'
++ )
+ def __eq__(self, other):
+ """Comparison method between two DVH objects.
+
+--- a/dicompylercore/util.py
++++ b/dicompylercore/util.py
+@@ -132,7 +132,7 @@ def piecewise(x, condlist, funclist, *ar
+ 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]]
+--- a/docs/conf.py
++++ b/docs/conf.py
+@@ -44,7 +44,7 @@ extensions = ['sphinx.ext.autodoc', 'sph
+ 'sphinx.ext.napoleon']
+
+ autodoc_mock_imports = [
+- 'numpy', 'dicom', 'pydicom', 'pydicom', 'dicom',
++ 'numpy', 'dicom', 'pydicom',
+ 'PIL', 'numpy.core', 'matplotlib', 'skimage', 'scipy']
+ autodoc_member_order = 'bysource'
+
+--- a/setup.py
++++ b/setup.py
+@@ -34,7 +34,7 @@ setup(
+ install_requires=[
+ "numpy>=1.2",
+ "six>=1.5",
+- "pydicom>=0.9.9",
++ "pydicom>=2.4.0,<4",
+ "matplotlib>=1.3.0"
+ ],
+ extras_require={
+@@ -57,11 +57,10 @@ setup(
+ 'Intended Audience :: Science/Research',
+ 'License :: OSI Approved :: BSD License',
+ 'Natural Language :: English',
+- 'Programming Language :: Python :: 3',
+- 'Programming Language :: Python :: 3.7',
+- 'Programming Language :: Python :: 3.8',
+- 'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
++ 'Programming Language :: Python :: 3.11',
++ 'Programming Language :: Python :: 3.12',
++ 'Programming Language :: Python :: 3.13',
+ 'Topic :: Scientific/Engineering :: Medical Science Apps.',
+ 'Topic :: Scientific/Engineering :: Physics'
+ ],
+--- a/tests/test_dicomparser.py
++++ b/tests/test_dicomparser.py
+@@ -7,16 +7,12 @@
+
+ import unittest
+ import os
+-from dicompylercore import dicomparser
+-from dicompylercore.config import pil_available, shapely_available
+-try:
+- from pydicom.multival import MultiValue as mv
+- from pydicom.valuerep import DSfloat
+-except ImportError:
+- from dicom.multival import MultiValue as mv
+- from dicom.valuerep import DSfloat
++from pydicom.multival import MultiValue as mv
++from pydicom.valuerep import DSfloat
+ from numpy import array, arange
+ from numpy.testing import assert_array_equal, assert_array_almost_equal
++from dicompylercore import dicomparser
++from dicompylercore.config import pil_available, shapely_available
+
+ basedata_dir = "tests/testdata"
+ example_data = os.path.join(basedata_dir, "example_data")
+--- a/tests/test_dose.py
++++ b/tests/test_dose.py
+@@ -9,16 +9,8 @@
+ from __future__ import division
+ import unittest
+ import os
+-from dicompylercore import dicomparser, dose
+
+-try:
+- from pydicom.dataset import Dataset
+- from pydicom.sequence import Sequence
+- from pydicom import read_file as read_dicom
+-except ImportError:
+- from dicom.dataset import Dataset
+- from dicom.sequence import Sequence
+- from dicom import read_file as read_dicom
++from pydicom import dcmread as read_dicom
+ from numpy import arange, zeros
+ from numpy.testing import (
+ assert_array_almost_equal,
+@@ -27,6 +19,7 @@ from numpy.testing import (
+ )
+ import warnings
+ from dicompylercore.config import mpl_available, scipy_available
++from dicompylercore import dicomparser, dose
+
+ basedata_dir = "tests/testdata"
+ example_data = os.path.join(basedata_dir, "example_data")
+--- a/tests/test_dvhcalc.py
++++ b/tests/test_dvhcalc.py
+@@ -8,19 +8,15 @@
+ from __future__ import division
+ import unittest
+ import os
++from pydicom.dataset import Dataset
++from pydicom.sequence import Sequence
++from numpy import arange
++from numpy.testing import assert_allclose
++from .util import fake_rtdose, fake_ss
+ from dicompylercore import dicomparser, dvhcalc
+ from dicompylercore.config import skimage_available
+ from dicompylercore.dvh import DVH
+ from dicompylercore.dvhcalc import get_dvh
+-try:
+- from pydicom.dataset import Dataset
+- from pydicom.sequence import Sequence
+-except ImportError:
+- from dicom.dataset import Dataset
+- from dicom.sequence import Sequence
+-from numpy import arange
+-from numpy.testing import assert_allclose
+-from .util import fake_rtdose, fake_ss
+
+
+ basedata_dir = "tests/testdata"
=====================================
debian/patches/series
=====================================
@@ -1,3 +1,4 @@
remove-six.patch
-adjust-collections.patch
+# adjust-collections.patch ... this is also in upstream patch 0d5729d7a2412e1c3f1e4cb4f6b07f7407eb8b06
skip-tight-comparison.patch
+0d5729d7a2412e1c3f1e4cb4f6b07f7407eb8b06.patch
=====================================
debian/rules
=====================================
@@ -3,4 +3,4 @@
# DH_VERBOSE := 1
%:
- dh $@ --with python3 --buildsystem=pybuild
+ dh $@ --buildsystem=pybuild
=====================================
debian/watch
=====================================
@@ -1,4 +1,4 @@
-version=4
+Version: 5
-opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%@PACKAGE at -$1.tar.gz%" \
- https://github.com/dicompyler/dicompyler-core/tags .*/v?@ANY_VERSION@@ARCHIVE_EXT@
+Template: Github
+Dist: https://github.com/dicompyler/dicompyler-core
View it on GitLab: https://salsa.debian.org/med-team/python-dicompylercore/-/compare/8eb5cc37764c21b30ae130342ff0267df0f99ea6...858b3f6fa2508e7a1dab4dee3e8d34a575c7a602
--
View it on GitLab: https://salsa.debian.org/med-team/python-dicompylercore/-/compare/8eb5cc37764c21b30ae130342ff0267df0f99ea6...858b3f6fa2508e7a1dab4dee3e8d34a575c7a602
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20260602/95ce4aeb/attachment-0001.htm>
More information about the debian-med-commit
mailing list