unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Antero Mejr via Guix-patches via <guix-patches@gnu.org>
To: 55989@debbugs.gnu.org
Subject: [bug#55989] [PATCH 1/2] gnu: Add python-pydicom.
Date: Wed, 15 Jun 2022 15:39:52 +0000	[thread overview]
Message-ID: <20220615153953.32070-1-antero@mailbox.org> (raw)
In-Reply-To: <20220615012714.1414-1-antero@mailbox.org>

Updated to add tests that don't use web resources.
Tested using the example code, reading/writing a dicom file and accessing
the pixel_array using numpy.

* gnu/packages/python-science.scm (python-pydicom): New variable.
---
 gnu/packages/python-science.scm | 51 +++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 0684826a6c..d26d3bc9b4 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2022 Paul A. Patience <paul@apatience.com>
 ;;; Copyright © 2022 Wiktor Żelazny <wzelazny@vurv.cz>
 ;;; Copyright © 2022 Eric Bavier <bavier@posteo.net>
+;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -46,6 +47,7 @@ (define-module (gnu packages python-science)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages gcc)
+  #:use-module (gnu packages image)
   #:use-module (gnu packages image-processing)
   #:use-module (gnu packages machine-learning)
   #:use-module (gnu packages maths)
@@ -1367,3 +1369,52 @@ (define-public python-gpy
 Python, from the Sheffield machine learning group.  GPy implements a range of
 machine learning algorithms based on GPs.")
     (license license:bsd-3)))
+
+(define-public python-pydicom
+  (package
+    (name "python-pydicom")
+    (version "2.3.0")
+    (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
+                "18l26s53yf5j9yh2zwq83n74qq4f2iq0cfblamsw4y9k35l1c108"))))
+    (build-system python-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (chdir "pydicom/tests")
+               (invoke "python3" "-m" "pytest" "-k" ;skip tests using web data
+                       (string-append
+                        "not test_jpeg_ls_pixel_data.py"
+                        " and not test_gdcm_pixel_data.py"
+                        " and not test_pillow_pixel_data.py"
+                        " and not test_rle_pixel_data.py"
+                        " and not Test_JPEG_LS_Lossless_transfer_syntax"
+                        " and not test_numpy_pixel_data.py"
+                        " and not test_data_manager.py"
+                        " and not test_handler_util.py"
+                        " and not test_overlay_np.py"
+                        " and not test_encoders_pydicom.py"
+                        " and not test_encaps.py"
+                        " and not test_reading_ds_with_known_tags_with_UN_VR"
+                        " and not TestDatasetOverlayArray"
+                        " and not TestReader"
+                        " and not test_filewriter.py"))))))))
+    (native-inputs (list python-pytest))
+    (inputs (list gdcm libjpeg-turbo))
+    (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{python-pydicom} is a Python library for reading
+and writing DICOM medical imaging data. It lets developers read, modify and
+write DICOM data in a pythonic way.")
+    (license license:expat)))
-- 
2.36.1





  parent reply	other threads:[~2022-06-15 15:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15  1:27 [bug#55989] [PATCH 1/2] gnu: Add python-pydicom Antero Mejr via Guix-patches via
2022-06-15  1:27 ` [bug#55988] [PATCH 2/2] gnu: Add gdcm Antero Mejr via Guix-patches via
2022-06-15  7:59 ` [bug#55989] [PATCH 1/2] gnu: Add python-pydicom Maxime Devos
2022-06-15 15:40   ` Antero Mejr via Guix-patches via
2022-06-15 15:39 ` Antero Mejr via Guix-patches via [this message]
2022-06-15 15:39   ` [bug#55989] [PATCH 2/2] gnu: Add gdcm Antero Mejr via Guix-patches via
2023-01-08 15:06     ` bug#55989: [PATCH 1/2] gnu: Add python-pydicom Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220615153953.32070-1-antero@mailbox.org \
    --to=guix-patches@gnu.org \
    --cc=55989@debbugs.gnu.org \
    --cc=antero@mailbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).