unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#68159] [PATCH] gnu: Add python-camb.
@ 2023-12-30 23:23 Troy Figiel
  2023-12-30 23:49 ` [bug#68159] (no subject) Troy Figiel
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Troy Figiel @ 2023-12-30 23:23 UTC (permalink / raw)
  To: 68159

* 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




^ permalink raw reply related	[flat|nested] 13+ messages in thread
[parent not found: <mailman.71232.1705523462.1170.guix-patches@gnu.org>]

end of thread, other threads:[~2024-01-24 15:41 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-30 23:23 [bug#68159] [PATCH] gnu: Add python-camb Troy Figiel
2023-12-30 23:49 ` [bug#68159] (no subject) Troy Figiel
2024-01-16 18:56 ` [bug#68159] [PATCH] gnu: Add python-camb Sharlatan Hellseher
2024-01-16 19:09   ` Sharlatan Hellseher
2024-01-17 15:19     ` Simon Tournier
2024-01-18 11:04       ` Sharlatan Hellseher
2024-01-17 11:14   ` Troy Figiel
2024-01-18 11:42 ` Troy Figiel
2024-01-24 15:07   ` bug#68159: " Maxim Cournoyer
2024-01-21 10:42 ` [bug#68159] " Sharlatan Hellseher
2024-01-21 12:11   ` Troy Figiel
     [not found] <mailman.71232.1705523462.1170.guix-patches@gnu.org>
2024-01-17 23:04 ` Troy Figiel
2024-01-18 10:45   ` Simon Tournier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).