diff mbox series

[bug#46492,5/5] Astronomy packages

Message ID CAO+9K5q4hMdgqELnUDBqXdwmmZ8SpVEC1NA7Y2t9YJPkDMnt4A@mail.gmail.com
State Accepted
Headers show
Series None | expand

Commit Message

Sharlatan Hellseher Feb. 13, 2021, 4:37 p.m. UTC
Hi Guix team!

This issue includes 5 more packages:

- astroalign
- sep
- pyerfa
- erfa
- qfits

Related issue https://issues.guix.gnu.org/46375
Progress https://github.com/Hellseher/guix-patches/blob/main/astronomy.org

--
… наш разум - превосходная объяснительная машина которая способна
найти смысл почти в чем угодно, истолковать любой феномен, но
совершенно не в состоянии принять мысль о непредсказуемости.

Comments

Guillaume Le Vaillant Feb. 19, 2021, 10:10 a.m. UTC | #1
Patches pushed as c1563fc116584cec517c9f5c866c661d3e7cec4e and
following.
Thanks.
diff mbox series

Patch

From 4537223357da02adcf118e4376bc6884be77cd86 Mon Sep 17 00:00:00 2001
From: Sharlatan Hellseher <sharlatanus@gmail.com>
Date: Sat, 13 Feb 2021 15:10:04 +0000
Subject: [PATCH 3/5] gnu: Add pyerfa

* gnu/packages/astronomy.scm (python-pyerfa): New variable.
---
 gnu/packages/astronomy.scm | 42 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index 8d58d64a1c..59afe21294 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -48,6 +48,7 @@ 
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pretty-print)
+  #:use-module (gnu packages python-check)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages version-control)
@@ -770,3 +771,44 @@  more.")
      "The package is a Python implementation of the mathematics that standard
 JPL ephemerides use to predict raw (x,y,z) planetary positions.")
     (license license:expat)))
+
+(define-public python-pyerfa
+  (package
+    (name "python-pyerfa")
+    (version "1.7.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pyerfa" version))
+       (sha256
+        (base32 "1s78mdyrxha2jcckfs0wg5ynkf0pwh1bw9mmh99vprinxh9n4xri"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           ;; Remove bundled submodule library.
+           (delete-file-recursively "liberfa")
+           #t))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'use-system-liberfa
+           (lambda _
+             (setenv "PYERFA_USE_SYSTEM_LIBERFA" "1")
+             #t)))))
+    (native-inputs
+     `(("pytest" ,python-pytest)
+       ("setuptools-scm" ,python-setuptools-scm)
+       ("pytest-doctestplus" ,python-pytest-doctestplus)))
+    (inputs
+     `(("liberfa" ,erfa)
+       ("numpy" ,python-numpy)))
+    (home-page "https://github.com/liberfa/pyerfa")
+    (synopsis "Python bindings for ERFA")
+    (description
+     "PyERFA is the Python wrapper for the ERFA library (Essential
+Routines for Fundamental Astronomy), a C library containing key algorithms for
+astronomy, which is based on the SOFA library published by the International
+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)))
-- 
2.30.0