guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: gnu: Add python-pynbody.


From: guix-commits
Subject: 02/02: gnu: Add python-pynbody.
Date: Fri, 5 Aug 2022 14:46:50 -0400 (EDT)

efraim pushed a commit to branch master
in repository guix.

commit 6615e82a63b7515a91aa453cab2c1788f4b1adf9
Author: Sharlatan Hellseher <sharlatanus@gmail.com>
AuthorDate: Fri Jul 29 21:17:50 2022 +0100

    gnu: Add python-pynbody.
    
    * gnu/packages/astronomy.scm: (python-pynbody): New variable.
    
    Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
---
 gnu/packages/astronomy.scm | 69 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index 3c4c92619e..29f1e6fc36 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -1739,6 +1739,75 @@ Astronomical Union (IAU).  All C routines are wrapped as 
Numpy universal
 functions, so that they can be called with scalar or array inputs.")
     (license license:bsd-3)))
 
+(define-public python-pynbody
+  (package
+    (name "python-pynbody")
+    (version "1.2.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pynbody" version))
+       (sha256
+        (base32 "1jxwk2s4qz1znvyak2lj7ld01kl1jh87xp81ki7a8dz1gcy93fkx"))))
+    (build-system python-build-system)
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'disable-tests-require-testdata
+                 (lambda _
+                   ;; Disable tests which need to download additional 1.0GiB+
+                   ;; of test data archive from
+                   ;; http://star.ucl.ac.uk/~app/testdata.tar.gz
+                   ;;    https://github.com/pynbody/pynbody/blob/ \
+                   ;;    f4bd482dc47532831b3ec115c7cb07149d61bfc5/ \
+                   ;;    .github/workflows/build-test.yaml#L41
+                   (with-directory-excursion "tests"
+                     (for-each delete-file
+                               '("gravity_test.py"
+                                 "adaptahop_test.py"
+                                 "ahf_halos_test.py"
+                                 "array_test.py"
+                                 "bridge_test.py"
+                                 "family_test.py"
+                                 "partial_tipsy_test.py"
+                                 "snapshot_test.py"
+                                 "test_profile.py"
+                                 "gadget_test.py"
+                                 "gadgethdf_test.py"
+                                 "grafic_test.py"
+                                 "halotools_test.py"
+                                 "nchilada_test.py"
+                                 "ramses_new_ptcl_format_test.py"
+                                 "ramses_test.py"
+                                 "rockstar_test.py"
+                                 "sph_image_test.py"
+                                 "sph_smooth_test.py"
+                                 "subfind_test.py"
+                                 "subfindhdf_gadget4_test.py"
+                                 "tipsy_test.py")))))
+               (replace 'check
+                 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+                   (when tests?
+                     (add-installed-pythonpath inputs outputs)
+                     (setenv "HOME" "/tmp")
+                     (invoke "pytest" "-vv")))))))
+    (native-inputs
+     (list python-cython
+           python-pandas
+           python-pytest))
+    (propagated-inputs
+     (list python-h5py
+           python-matplotlib
+           python-numpy
+           python-posix-ipc
+           python-scipy))
+    (home-page "https://pynbody.github.io/pynbody/index.html";)
+    (synopsis "Light-weight astronomical N-body/SPH analysis for python")
+    (description "@code{Pynbody} is an analysis framework for N-body and 
hydrodynamic
+astrophysical simulations supporting PKDGRAV/Gasoline, Gadget, Gadget4/Arepo,
+N-Chilada and RAMSES AMR outputs.")
+    (license license:gpl3+)))
+
 (define-public python-sep
   (package
     (inherit libsep)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]