guix_mirror_bot pushed a commit to branch astro-updates
in repository guix.

commit 39a6e8561e9e5505bee86435e1159b264d59c654
Author: Sharlatan Hellseher <[email protected]>
AuthorDate: Fri Nov 14 13:25:41 2025 +0000

    gnu: Add python-nestcheck.
    
    * gnu/packages/python-science.scm (python-nestcheck): New variable.
    
    Change-Id: Ieb2d6942e0f8f802853f821bc13c3b86aee74a6f
---
 gnu/packages/python-science.scm | 64 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index f938770880..080bab2436 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -2074,6 +2074,70 @@ between dataframe libraries.
 indices of @code{ndarrays}.")
     (license license:expat)))
 
+(define-public python-nestcheck
+  (package
+    (name "python-nestcheck")
+    ;; 0.2.1 was placed in 2019, there are a lot of changes providing
+    ;; comparability with Python 3.11, use the latest commit from master's
+    ;; HEAD.
+    (properties '((commit . "513ef962ef7b0d66377686f9fe0a9e354dad48b3")
+                  (revision . "0")))
+    (version (git-version "0.2.1"
+                          (assoc-ref properties 'revision)
+                          (assoc-ref properties 'commit)))
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+              (url "https://github.com/ejhigson/nestcheck";)
+              (commit (assoc-ref properties 'commit))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0zzms2jkiapawnjyr5i7c61m7pmg6yd3nmpv23bdx51glz2fmglc"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      ;; tests: 58 passed, 6 deselected, 10 warnings
+      #:test-flags
+      ;; TypeError: MultiIndex.set_levels() got an unexpected keyword argument
+      ;; 'inplace'
+      #~(list "-k" (string-append "not test_run_list_error_summary"
+                                  ;; AttributeError: 'Series' object has no
+                                  ;; attribute 'iteritems'
+                                  " and not test_kde_plot_df"
+                                  ;; Test is not determenistic and fails with
+                                  ;; assertion not equal for DF array.
+                                  " and not test_summary_df"))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'use-pytest
+            (lambda _
+              (substitute* "tests/test_core.py"
+                (("'nose'") "'pytest'")))))))
+    (native-inputs
+     (list python-pytest
+           python-setuptools))
+    (propagated-inputs
+     (list python-fgivenx
+           python-matplotlib
+           python-numpy
+           python-pandas
+           python-scipy
+           python-tqdm))
+    (home-page "https://github.com/ejhigson/nestcheck";)
+    (synopsis "Nested sampling calculations utilities")
+    (description
+     "This package implements a functionality to work with
+@url{https://en.wikipedia.org/wiki/Nested_sampling_algorithm, Nested
+sampling}, a popular numerical method for Bayesian computation, which
+simultaneously generates samples from the posterior distribution and an
+estimate of the Bayesian evidence for a given likelihood and prior.
+@code{nestcheck} provides Python utilities for analysing samples produced by
+nested sampling, and estimating uncertainties on nested sampling
+calculations (which have different statistical properties to calculations
+using other numerical methods).")
+    (license license:expat)))
+
 (define-public python-nibabel
   (package
     (name "python-nibabel")

Reply via email to