Subject: [PATCH 29/34] gnu: Add python-sbpy.

From: Sharlatan Hellseher <[email-masked]>
Date: Sat, 20 Jul 2024 23:40:52 +0100

* gnu/packages/astronomy.scm (python-sbpy): New variable.

Change-Id: I456f1400ce072d3a2e4cd263349f57c5779f36c5
---
 gnu/packages/astronomy.scm | 68 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index c25e49e411..307d85578f 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -57,6 +57,7 @@ (define-module (gnu packages astronomy)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
   #:use-module (gnu packages image-processing)
+  #:use-module (gnu packages jupyter)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages lua)
@@ -4641,6 +4642,73 @@ (define-public python-pysynphot
 spectra, and data.")
       (license license:bsd-3))))
 
+(define-public python-sbpy
+  (package
+    (name "python-sbpy")
+    (version "0.4.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "sbpy" version))
+       (sha256
+        (base32 "18f3056fgzpvjj43m845wl9znl4dqxs8f8qv3gpay7kik4l8a1fc"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:test-flags
+      ;; See <https://github.com/NASA-Planetary-Science/sbpy/issues/397>.
+      #~(list "--ignore=sbpy/spectroscopy/tests/test_specgrad.py"
+              ;; See <https://github.com/NASA-Planetary-Science/sbpy/issues/398>
+              "-k" (string-append "not test_from_fluxd"
+                                  " and not test_bandpass"
+                                  " and not test_spectral_density_vega_bp"))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'check 'set-home-env
+            (lambda _
+              ;; Tests require HOME to be set.
+              ;;  No such file or directory: '/homeless-shelter/.astropy'
+              (setenv "HOME" "/tmp"))))))
+    (propagated-inputs
+     (list python-ads
+           python-astropy
+           python-astroquery
+           python-ginga
+           python-numpy
+           python-photutils
+           python-pyyaml
+           python-scipy
+           python-synphot))
+    (native-inputs
+     (list python-pytest
+           python-pytest-astropy
+           python-pytest-doctestplus
+           python-pytest-remotedata
+           python-pytest-xdist
+           python-setuptools-scm))
+    (home-page "https://sbpy.org")
+    (synopsis "Python module for small-body planetary astronomy")
+    (description
+     "@code{sbpy} is a package for small-body planetary astronomy.  It is
+meant to supplement functionality provided by @code{astropy} with functions
+and methods that are frequently used in the context of planetary astronomy
+with a clear focus on asteroids and comets.
+Features:
+@itemize
+@item observation planning tools tailored to moving objects
+@item photometry models for resolved and unresolved observations
+@item wrappers and tools for astrometry and orbit fitting
+@item spectroscopy analysis tools and models for reflected solar light and
+emission from gas
+@item cometary gas and dust coma simulation and analysis tools
+@item asteroid thermal models for flux estimation and size/albedo estimation
+@item image enhancement tools for comet comae and PSF subtraction tools
+@item lightcurve and shape analysis tools
+@item access tools for various databases for orbital and physical data, as
+well as ephemerides services
+@end itemize")
+    (license license:bsd-3)))
+
 (define-public python-sep
   (package/inherit libsep
     (name "python-sep")
-- 
2.41.0