[PATCH] gnu: Add python-pynetdicom.

  • Done
  • quality assurance status badge
Details
3 participants
  • Antero Mejr
  • Maxim Cournoyer
  • Sharlatan Hellseher
Owner
unassigned
Submitted by
Antero Mejr
Severity
normal
A
A
Antero Mejr wrote on 3 Dec 2022 06:03
(address . guix-patches@gnu.org)(name . Antero Mejr)(address . antero@mailbox.org)
20221203050357.30524-1-antero@mailbox.org
* gnu/packages/python-science.scm (python-pynetdicom): New variable.
---
gnu/packages/python-science.scm | 41 +++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)

Toggle diff (54 lines)
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 00bba25a4a..d45bcd9bca 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -1702,6 +1702,47 @@ (define-public python-pydicom
in a pythonic way.")
(license license:expat)))
+(define-public python-pynetdicom
+ (package
+ (name "python-pynetdicom")
+ (version "2.0.2")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "pynetdicom" version))
+ (sha256
+ (base32
+ "0farmgviaarb3f4xn751card3v0lza57vwgl5azxxq65p7li44i3"))))
+ (build-system python-build-system)
+ (arguments
+ (list #:phases #~(modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "pytest" "-vv" "-k"
+ ;; network tests, 2977/3283 pass
+ (string-append
+ " not TestFindSCP"
+ " and not TestQRGetServiceClass"
+ " and not TestQRMoveServiceClass"
+ " and not TestStoreSCP"
+ " and not test_ae.py"
+ " and not test_echoscp.py"
+ " and not test_qrscp_echo.py"
+ " and not test_storescp.py"
+ " and not test_pr_level_patient"
+ " and not test_pr_level_series"
+ " and not test_scp_cancelled"))))))))
+ (native-inputs (list python-pyfakefs python-pytest))
+ (propagated-inputs (list python-pydicom python-sqlalchemy))
+ (home-page "https://github.com/pydicom/pynetdicom")
+ (synopsis "Python implementation of the DICOM networking protocol")
+ (description
+ "@code{pynetdicom} is a Python package that implements the DICOM
+networking protocol. Working with @code{pydicom}, it allows the easy creation
+of DICOM @acronym{SCUs,Service Class Users} and
+@acronym{SCPs,Service Class Providers}.")
+ (license license:expat)))
+
;;;
;;; Avoid adding new packages to the end of this file. To reduce the chances
;;; of a merge conflict, place them above by existing packages with similar
--
2.38.1
A
A
Antero Mejr wrote on 3 Dec 2022 06:08
[PATCH] gnu: Add python-pydicom.
(address . 59792@debbugs.gnu.org)(name . Antero Mejr)(address . antero@mailbox.org)
20221203050829.30666-1-antero@mailbox.org
* gnu/packages/python-science.scm (python-pydicom): New variable.
---
Please apply this patch first.
Supersedes #55989.

gnu/packages/python-science.scm | 46 +++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)

Toggle diff (59 lines)
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 52fe1460bb..00bba25a4a 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -1656,6 +1656,52 @@ (define-public python-vaex-core
tabular datasets. This package provides the core modules of Vaex.")
(license license:expat)))
+(define-public python-pydicom
+ (package
+ (name "python-pydicom")
+ (version "2.3.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/pydicom/pydicom")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0q209i2jgwv5z1xhi7frydkplby7jaiz624pjq6vi51wvlmimpf6"))))
+ (build-system python-build-system)
+ (arguments
+ (list #:phases #~(modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ ;; skip tests using external data
+ (invoke "pytest" "-vv" "-k"
+ (string-append
+ " not TestDataElement"
+ " and not TestDatasetOverlayArray"
+ " and not TestReader"
+ " and not Test_JPEG_LS_Lossless_transfer_syntax"
+ " and not test_data_manager.py"
+ " and not test_encaps.py"
+ " and not test_encoders_pydicom.py"
+ " and not test_filewriter.py"
+ " and not test_gdcm_pixel_data.py"
+ " and not test_handler_util.py"
+ " and not test_jpeg_ls_pixel_data.py"
+ " and not test_numpy_pixel_data.py"
+ " and not test_overlay_np.py"
+ " and not test_pillow_pixel_data.py"
+ " and not test_rle_pixel_data.py"))))))))
+ (native-inputs (list python-pytest))
+ (propagated-inputs (list python-numpy python-pillow))
+ (home-page "https://github.com/pydicom/pydicom")
+ (synopsis "Python library for reading and writing DICOM data")
+ (description "@code{pydicom} is a Python library for reading and writing
+DICOM medical image files. It lets developers read, modify and write DICOM data
+in a pythonic way.")
+ (license license:expat)))
+
;;;
;;; Avoid adding new packages to the end of this file. To reduce the chances
;;; of a merge conflict, place them above by existing packages with similar
--
2.38.1
M
M
Maxim Cournoyer wrote on 16 Jan 2023 15:50
Re: bug#59792: [PATCH] gnu: Add python-pynetdicom.
(name . Antero Mejr)(address . antero@mailbox.org)
87lem2a5zx.fsf_-_@gmail.com
Hello Antero!

Antero Mejr <antero@mailbox.org> writes:

Toggle quote (2 lines)
> * gnu/packages/python-science.scm (python-pydicom): New variable.

Thanks for this contribution.

Toggle quote (35 lines)
> Please apply this patch first.
> Supersedes #55989.
>
> gnu/packages/python-science.scm | 46 +++++++++++++++++++++++++++++++++
> 1 file changed, 46 insertions(+)
>
> diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
> index 52fe1460bb..00bba25a4a 100644
> --- a/gnu/packages/python-science.scm
> +++ b/gnu/packages/python-science.scm
> @@ -1656,6 +1656,52 @@ (define-public python-vaex-core
> tabular datasets. This package provides the core modules of Vaex.")
> (license license:expat)))
>
> +(define-public python-pydicom
> + (package
> + (name "python-pydicom")
> + (version "2.3.1")
> + (source (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/pydicom/pydicom")
> + (commit (string-append "v" version))))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32
> + "0q209i2jgwv5z1xhi7frydkplby7jaiz624pjq6vi51wvlmimpf6"))))
> + (build-system python-build-system)
> + (arguments
> + (list #:phases #~(modify-phases %standard-phases
> + (replace 'check
> + (lambda* (#:key tests? #:allow-other-keys)
> + (when tests?
> + ;; skip tests using external data

Well done! Please use a complete sentence for stand-alone comments,
e.g. ";; Skip tests that require networking."

Toggle quote (18 lines)
> + (invoke "pytest" "-vv" "-k"
> + (string-append
> + " not TestDataElement"
> + " and not TestDatasetOverlayArray"
> + " and not TestReader"
> + " and not Test_JPEG_LS_Lossless_transfer_syntax"
> + " and not test_data_manager.py"
> + " and not test_encaps.py"
> + " and not test_encoders_pydicom.py"
> + " and not test_filewriter.py"
> + " and not test_gdcm_pixel_data.py"
> + " and not test_handler_util.py"
> + " and not test_jpeg_ls_pixel_data.py"
> + " and not test_numpy_pixel_data.py"
> + " and not test_overlay_np.py"
> + " and not test_pillow_pixel_data.py"
> + " and not test_rle_pixel_data.py"))))))))

Suggestion: If you use pyproject-build-system, you can avoid overriding
the test phase, instead making use of the new #:test-flags argument, to
provide just the "-k" and patterns.

Toggle quote (8 lines)
> + (native-inputs (list python-pytest))
> + (propagated-inputs (list python-numpy python-pillow))
> + (home-page "https://github.com/pydicom/pydicom")
> + (synopsis "Python library for reading and writing DICOM data")
> + (description "@code{pydicom} is a Python library for reading and writing
> +DICOM medical image files. It lets developers read, modify and write DICOM data
> +in a pythonic way.")

I'd avoid "developers", and plainly state: "It can read, modify [...]",
and drop "in a pythonic way" since that's more subjective than facts.

--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 16 Jan 2023 15:53
(name . Antero Mejr)(address . antero@mailbox.org)
87edrua5uy.fsf@gmail.com
Hi again,

Antero Mejr <antero@mailbox.org> writes:

Toggle quote (44 lines)
> * gnu/packages/python-science.scm (python-pynetdicom): New variable.
> ---
> gnu/packages/python-science.scm | 41 +++++++++++++++++++++++++++++++++
> 1 file changed, 41 insertions(+)
>
> diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
> index 00bba25a4a..d45bcd9bca 100644
> --- a/gnu/packages/python-science.scm
> +++ b/gnu/packages/python-science.scm
> @@ -1702,6 +1702,47 @@ (define-public python-pydicom
> in a pythonic way.")
> (license license:expat)))
>
> +(define-public python-pynetdicom
> + (package
> + (name "python-pynetdicom")
> + (version "2.0.2")
> + (source (origin
> + (method url-fetch)
> + (uri (pypi-uri "pynetdicom" version))
> + (sha256
> + (base32
> + "0farmgviaarb3f4xn751card3v0lza57vwgl5azxxq65p7li44i3"))))
> + (build-system python-build-system)
> + (arguments
> + (list #:phases #~(modify-phases %standard-phases
> + (replace 'check
> + (lambda* (#:key tests? #:allow-other-keys)
> + (when tests?
> + (invoke "pytest" "-vv" "-k"
> + ;; network tests, 2977/3283 pass
> + (string-append
> + " not TestFindSCP"
> + " and not TestQRGetServiceClass"
> + " and not TestQRMoveServiceClass"
> + " and not TestStoreSCP"
> + " and not test_ae.py"
> + " and not test_echoscp.py"
> + " and not test_qrscp_echo.py"
> + " and not test_storescp.py"
> + " and not test_pr_level_patient"
> + " and not test_pr_level_series"
> + " and not test_scp_cancelled"))))))))

The same tip as offered earlier should work here too (using
pyproject-build-system and its #:test-flags argument).

Toggle quote (11 lines)
> + (native-inputs (list python-pyfakefs python-pytest))
> + (propagated-inputs (list python-pydicom python-sqlalchemy))
> + (home-page "https://github.com/pydicom/pynetdicom")
> + (synopsis "Python implementation of the DICOM networking protocol")
> + (description
> + "@code{pynetdicom} is a Python package that implements the DICOM
> +networking protocol. Working with @code{pydicom}, it allows the easy creation
> +of DICOM @acronym{SCUs,Service Class Users} and
> +@acronym{SCPs,Service Class Providers}.")
> + (license license:expat)))

I'd drop the "Working with @code{pydicom}, " and start the sentence
directly from "It allows the creation of [...]".

--
Thanks,
Maxim
S
S
Sharlatan Hellseher wrote on 24 Jan 01:18 +0100
[PATCH] gnu: Add python-pynetdicom.
(address . 59792-done@debbugs.gnu.org)
87h6j3mvmu.fsf@gmail.com
Hi,

I've fixed merge conflicts and sort package approximately alphabetically
apply python-pynetdicom and Maxim's suggestions in separate commits.

- python-pydicom was added already
- commit :: e24b9b42bc9a78bc63e6824e74fc6850e8a90490

The patch adding python-pynetdicom pushed as
e71abbc6438f2b25f0d41221fadf695dfe094689 to master.

Thanks,
Oleg
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEmEeB3micIcJkGAhndtcnv/Ys0rUFAmWwV1kACgkQdtcnv/Ys
0rV6kA//ZwuQyaB6Z+b2DOkgI3MeTTyo7yW5IhPgvmwBn09PqSr89yv5e701gtRy
l0VjAJct2fs3X22g9w+hKAYlsT1v+4ooSjPf77A/hGwu1V8PdxQ5m6kGLvEqV+pn
Nl6xt7pI8mTC8jcjGt5HMbkjDrO/aKWY/cYla/4k+4ApmK9iMfIjZPMuhTw0+X+y
DJwwGM4iMapwyUSmi68Qf4bSSBET5KpAMtIF0XHnMTgUFp2eMeQrSm8vmeL2KY/9
M88JKxvlkgMC3AwFYkpSkCYTfKtN08WOvhuYeckCjxbNDw96jvECL5ePX6GleF0o
rPn9JG6uVbtpwvyNlqdVZtZfFtqHed7UtFtxr6ddTcSMYV0j35kANrSgtK6nOU+e
fM2b8O0Z28nJ7l2eXpI9xvxbBI77YywVUZeSdywUcNRGB0x54dxWiKJJBfwtIm3r
07FLKzYtDNGg/VWAqHx54TQ+a9N7a10uLon+KBUBLfUdGa5IkXR0WLOJNfT3Paao
wPsUZvdYmy78Irvzbh0A5w8o+tlEwjmM6t8DY3btUvwTsIdtFX3z6mYr64PzcIur
6XRU0dBSlxIFemQPvAkhHWfNxpWDi+Tx6GaI7We6x+yxUeH/iUigCkWgt/eyBIU7
rLSnFvFNZBOPShyJ855XjraRbfdo20gs5qc2A/3iaJ1TYG7XZX8=
=aAuY
-----END PGP SIGNATURE-----

Closed
?