--- Begin Message ---
Subject: |
[PATCH] gnu: Add python-camb. |
Date: |
Sun, 31 Dec 2023 00:23:09 +0100 |
* 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 <tikhonenko@mpe.mpg.de>
;;; Copyright © 2023 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2023 Troy Figiel <troy@troyfigiel.com>
;;;
;;; 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
--- End Message ---
--- Begin Message ---
Subject: |
Re: [bug#68159] [PATCH] gnu: Add python-camb. |
Date: |
Wed, 24 Jan 2024 10:07:39 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hi Troy,
Troy Figiel <troy@troyfigiel.com> 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
--- End Message ---