[PATCH 0/2] Add python-bambi.

  • Open
  • quality assurance status badge
Details
2 participants
  • Vinicius Monego
  • Sharlatan Hellseher
Owner
unassigned
Submitted by
Vinicius Monego
Severity
normal
V
V
Vinicius Monego wrote on 5 Dec 2023 16:28
(address . guix-patches@gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
cover.1701789886.git.monego@posteo.net
Bambi is a high-level Bayesian model-building interface for PyMC.

Vinicius Monego (2):
gnu: Add python-formulae.
gnu: Add python-bambi.

gnu/packages/statistics.scm | 107 +++++++++++++++++++++++++++++++++---
1 file changed, 100 insertions(+), 7 deletions(-)


base-commit: c15a1cd88f80a90437f4b0159f22dfc84b9e6851
--
2.39.2
V
V
Vinicius Monego wrote on 5 Dec 2023 16:30
[PATCH 2/2] gnu: Add python-bambi.
(address . 67643@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
758492077c8b05e2aee5aca1726379322bcbb277.1701789886.git.monego@posteo.net
* gnu/packages/statistics.scm: Sort modules alphabetically.
(python-bambi): New variable.

Change-Id: I54931227310e3ad3b8d5c9272dcc641877b78bfb
---
gnu/packages/statistics.scm | 77 +++++++++++++++++++++++++++++++++----
1 file changed, 70 insertions(+), 7 deletions(-)

Toggle diff (127 lines)
diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index 30c6a9483e..c9a9672a35 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -35,25 +35,26 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages statistics)
- #:use-module (guix gexp)
#:use-module ((guix licenses) #:prefix license:)
- #:use-module (guix packages)
#:use-module (guix download)
- #:use-module (guix hg-download)
+ #:use-module (guix gexp)
#:use-module (guix git-download)
+ #:use-module (guix hg-download)
+ #:use-module (guix packages)
#:use-module (guix utils)
#:use-module (guix build-system ant)
#:use-module (guix build-system cmake)
#:use-module (guix build-system emacs)
#:use-module (guix build-system gnu)
- #:use-module (guix build-system r)
#:use-module (guix build-system pyproject)
#:use-module (guix build-system python)
- #:use-module (guix build-system trivial)
+ #:use-module (guix build-system r)
#:use-module (guix build-system ruby)
+ #:use-module (guix build-system trivial)
#:use-module (gnu packages)
#:use-module (gnu packages algebra)
#:use-module (gnu packages autotools)
+ #:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages bison)
#:use-module (gnu packages boost)
@@ -66,9 +67,10 @@ (define-module (gnu packages statistics)
#:use-module (gnu packages flex)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages gcc)
- #:use-module (gnu packages gtk)
#:use-module (gnu packages gettext)
#:use-module (gnu packages glib)
+ #:use-module (gnu packages graphviz)
+ #:use-module (gnu packages gtk)
#:use-module (gnu packages haskell-xyz)
#:use-module (gnu packages icu4c)
#:use-module (gnu packages image)
@@ -100,7 +102,6 @@ (define-module (gnu packages statistics)
#:use-module (gnu packages texinfo)
#:use-module (gnu packages time)
#:use-module (gnu packages tls)
- #:use-module (gnu packages base)
#:use-module (gnu packages uglifyjs)
#:use-module (gnu packages version-control)
#:use-module (gnu packages web)
@@ -2266,6 +2267,68 @@ (define-public python-formulae
for mixed-effects models.")
(license license:expat)))
+(define-public python-bambi
+ (package
+ (name "python-bambi")
+ (version "0.13.0")
+ (source
+ (origin
+ (method git-fetch) ;PyPI is missing files required by tests
+ (uri (git-reference
+ (url "https://github.com/bambinos/bambi")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1hkkw65nbxg15rzp9rc8zxxwsg454hfa5mq853752hp6bp4r7szp"))))
+ (build-system pyproject-build-system)
+ (arguments
+ ;; The tests below use the network, and there's no configuration to
+ ;; skip the network tests.
+ (list
+ #:test-flags
+ #~(list "--ignore"
+ "tests/test_aliases.py"
+ "--ignore"
+ "tests/test_plots.py"
+ "-k"
+ (string-append
+ "not "
+ (string-join
+ (list
+ "test_logistic_regression_categoric_alternative_samplers"
+ "test_regression_alternative_samplers"
+ "test_predict_new_groups"
+ "test_predict_new_groups_fail"
+ "test_censored_response"
+ "test_data_is_copied"
+ "test_extra_namespace"
+ "test_predict_offset"
+ "test_custom_prior"
+ "test_normal_with_splines"
+ "test_gamma_with_splines")
+ " and not ")))
+ #:phases #~(modify-phases %standard-phases
+ (add-before 'check 'pre-check
+ (lambda _
+ ;; Some tests require write permission.
+ (setenv "HOME" "/tmp"))))))
+ (propagated-inputs (list python-arviz python-formulae python-graphviz
+ python-pandas python-pymc))
+ (native-inputs (list python-black
+ python-ipython
+ python-pylint
+ python-pytest
+ python-pytest-cov
+ python-seaborn))
+ (home-page "https://bambinos.github.io/bambi/")
+ (synopsis "Bayesian Model Building Interface in Python")
+ (description
+ "Bambi is a high-level Bayesian model-building interface written in Python.
+It's built on top of the PyMC probabilistic programming framework, and is
+designed to make it extremely easy to fit mixed-effects models common in
+social sciences settings using a Bayesian approach.")
+ (license license:expat)))
+
(define-public python-chaospy
(package
(name "python-chaospy")
--
2.39.2
V
V
Vinicius Monego wrote on 5 Dec 2023 16:30
[PATCH 1/2] gnu: Add python-formulae.
(address . 67643@debbugs.gnu.org)(name . Vinicius Monego)(address . monego@posteo.net)
083385b33f32b09e11ef1bd4e1ce7063de8918fb.1701789886.git.monego@posteo.net
* gnu/packages/statistics.scm (python-formulae): New variable.

Change-Id: I65f5c71fd30679b11fe370372d6992df54d86f19
---
gnu/packages/statistics.scm | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)

Toggle diff (43 lines)
diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index 95cc948d9f..30c6a9483e 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -2236,6 +2236,36 @@ (define-public python-pymc
inference (VI) algorithms.")
(license license:asl2.0)))
+(define-public python-formulae
+ (package
+ (name "python-formulae")
+ (version "0.5.1")
+ (source (origin
+ (method git-fetch) ; PyPI is missing files required by tests
+ (uri (git-reference
+ (url "https://github.com/bambinos/formulae")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0s22ggsss1zrz3bdw1zm3kwbm07bdlp0v1af8xhw8ymcg9sqcsly"))))
+ (build-system pyproject-build-system)
+ (arguments
+ ;; AssertionError: approx() is not supported in a boolean context.
+ (list #:test-flags #~(list "-k" "not test_basic and not test_degree")))
+ (propagated-inputs (list python-numpy python-pandas python-scipy))
+ (native-inputs (list python-black
+ python-ipython
+ python-pylint
+ python-pytest
+ python-pytest-cov))
+ (home-page "https://bambinos.github.io/formulae/")
+ (synopsis "Formulas for mixed-effects models in Python")
+ (description
+ "@code{formulae} is a Python library that implements Wilkinson’s formulas
+for mixed-effects models.")
+ (license license:expat)))
+
(define-public python-chaospy
(package
(name "python-chaospy")
--
2.39.2
S
S
Sharlatan Hellseher wrote on 2 Feb 21:30 +0100
[PATCH 0/2] Add python-bambi.
(address . 67643@debbugs.gnu.org)
CAO+9K5qZFXSRDXbi44DXKTgrpq6gCiEeQ+p_CE0C=Q6feBO0rA@mail.gmail.com
Hi,

Thank you for the patches!

From a quick glance they look good, I am about to check
upstream license(s) and any hidden bundled code/libraries.

One neat pick. You combined adding new package with module
house keeping changes (sorting use-module alphabetically), to
make a review smoother may you split it into 3 please, with house
keeping part as separate patch?

Looking forward for v2!

Thanks,
Oleg
Attachment: file
?