Subject: bug#68159: closed (Re: [bug#68159] [PATCH] gnu: Add python-camb.)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 24 Jan 2024 15:08:01 +0000

Your bug report

#68159: [PATCH] gnu: Add python-camb.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
68159: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68159
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#68159] [PATCH] gnu: Add python-camb.
From: Maxim Cournoyer <[email-masked]>
To: Troy Figiel <[email-masked]>
Cc: Sharlatan Hellseher <[email-masked]>, [email-masked], Simon Tournier <[email-masked]>
Date: Wed, 24 Jan 2024 10:07:39 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Troy,

Troy Figiel <[email-masked]> writes:

> Hi both of you,
>
> Thank you for the review and the investigative work! That sounds like a
> good idea, I will have a look at guix-science and guix-science-nonfree
> instead.

Thanks to Simon for reviewing the license details, which indeed appear
non-free.

-- 
Thanks,
Maxim

Subject: [PATCH] gnu: Add python-camb.
From: Troy Figiel <[email-masked]>
To: [email-masked]
Date: Sun, 31 Dec 2023 00:23:09 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

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

diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index da15283ef3..82643510df 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2023 Iliya Tikhonenko <[email-masked]>
 ;;; Copyright © 2023 Andreas Enge <[email-masked]>
 ;;; Copyright © 2023 Simon Tournier <[email-masked]>
+;;; Copyright © 2023 Troy Figiel <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1732,6 +1733,58 @@ (define-public python-bayesicfitting
 Herschel.")
     (license license:gpl3+)))
 
+(define-public python-camb
+  ;; The test outputs that are compared against the outputs of the tests in
+  ;; hmcode_test.py are part of an unreleased git repository.
+  (let* ((url "https://github.com/alexander-mead/HMcode_test_outputs")
+         (commit "03cfe3e8bda9335332cbdbd10785f425b4275820")
+         (hash "15092c96layjzp3k3g7cv5kzs42i7dkgmszhkjhch9hl8rdyhp4d")
+         (test-outputs (origin
+                         (method git-fetch)
+                         (uri (git-reference (url url)
+                                             (commit commit)))
+                         (sha256 (base32 hash)))))
+    (package
+      (name "python-camb")
+      (version "1.5.2")
+      (source
+       (origin
+         (method url-fetch)
+         (uri (pypi-uri "camb" version))
+         (sha256
+          (base32 "1li20qj1qfcg6i9l71ijgd5s2saii5bvszbaq72pn8q7d4q5w29m"))))
+      (build-system python-build-system)
+      (arguments
+       (list
+        #:phases #~(modify-phases %standard-phases
+                     (add-before 'check 'copy-test-outputs
+                       (lambda _
+                         ;; hmcode_test.py expects the test output in the
+                         ;; HMcode_test_outputs directory.
+                         (copy-recursively #$(this-package-native-input
+                                              "test-outputs")
+                                           "HMcode_test_outputs"))))))
+      (propagated-inputs (list python-packaging python-scipy python-sympy))
+      (native-inputs `(("gfortran" ,gfortran)
+                       ;; The which command is used to check whether ifort or
+                       ;; gfortran exist.
+                       ("which" ,which)
+                       ("test-outputs" ,test-outputs)))
+      (home-page "https://camb.info/")
+      (synopsis "Code for Anisotropies in the Microwave Background")
+      (description
+       "@code{python-camb} is a Python package that can be used to calculate
+the cosmic microwave background, lensing, galaxy count, dark-age 21cm power
+spectra, matter power spectra and transfer functions.  There are also general
+utility functions for cosmological calculations such as the background
+expansion and distances.")
+      ;; This package is dual-licensed, because it is also based on the older
+      ;; programs CMBFAST and COSMICS. Notices can be found in the appropriate
+      ;; source files. The original CMBFAST copyright notice can be found in
+      ;; LICENSE.txt. See https://web.mit.edu/edbert/cosmics-1.04.tar.gz for
+      ;; the original COSMICS license.
+      (license (list license:expat license:lgpl3+)))))
+
 (define-public python-casa-formats-io
   (package
     (name "python-casa-formats-io")

base-commit: b8aea26c4f45dfb34deefe980c6d6002d6aa12f3
-- 
2.40.1