[PATCH 0/2] Add pgmpy library for Bayesian Networks.

  • Done
  • quality assurance status badge
Details
2 participants
  • Felix Gruber
  • Sharlatan Hellseher
Owner
unassigned
Submitted by
Felix Gruber
Severity
normal
F
F
Felix Gruber wrote on 23 Jun 2023 23:11
(address . guix-patches@gnu.org)(name . Felix Gruber)(address . felgru@posteo.net)
cover.1687554528.git.felgru@posteo.net
This patchset adds the python-pgmpy library and its dependency
python-daft.

Felix Gruber (2):
gnu: Add python-daft.
gnu: Add python-pgmpy.

gnu/packages/python-xyz.scm | 49 ++++++++++++++++++++++++++++++++++++-
gnu/packages/statistics.scm | 44 +++++++++++++++++++++++++++++++++
2 files changed, 92 insertions(+), 1 deletion(-)


base-commit: f25529b08e356f89ca7cecc44295085531a8faba
--
2.39.2
F
F
Felix Gruber wrote on 23 Jun 2023 23:12
[PATCH 1/2] gnu: Add python-daft.
(address . 64258@debbugs.gnu.org)(name . Felix Gruber)(address . felgru@posteo.net)
f0de7856fd062eb3854607d9305fce8a504008a3.1687554529.git.felgru@posteo.net
* gnu/packages/python-xyz.scm (python-daft): New variable.
---
gnu/packages/python-xyz.scm | 49 ++++++++++++++++++++++++++++++++++++-
1 file changed, 48 insertions(+), 1 deletion(-)

Toggle diff (69 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index b650b71f3b..7ccf2d352b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -108,7 +108,7 @@
;;; Copyright © 2021 Simon Streit <simon@netpanic.org>
;;; Copyright © 2021 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>
;;; Copyright © 2021, 2022 Pradana Aumars <paumars@courrier.dev>
-;;; Copyright © 2021, 2022 Felix Gruber <felgru@posteo.net>
+;;; Copyright © 2021, 2022, 2023 Felix Gruber <felgru@posteo.net>
;;; Copyright © 2021 Sébastien Lerique <sl@eauchat.org>
;;; Copyright © 2021 Raphaël Mélotte <raphael.melotte@mind.be>
;;; Copyright © 2021 ZmnSCPxj <ZmnSCPxj@protonmail.com>
@@ -3962,6 +3962,53 @@ (define-public python-pomegranate
Cython for speed.")
(license license:expat)))
+(define-public python-daft
+ (package
+ (name "python-daft")
+ (version "0.1.2")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "daft" version))
+ (sha256
+ (base32
+ "1r8jsfavd624q2q61f863lk6has6mv5csswh39saafd5khwf0xry"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:test-flags
+ '(list "-k"
+ (string-append
+ ;; The following tests compare matplotlib output with
+ ;; previously generated images. They fail due to minor
+ ;; differences in where matplotlib places labels.
+ "not test_bca[png]"
+ " and not test_classic[png]"
+ " and not test_deconvolution[png]"
+ " and not test_exoplanets[png]"
+ " and not test_fixed[png]"
+ " and not test_gaia[png]"
+ " and not test_galex[png]"
+ " and not test_huey_p_newton[png]"
+ " and not test_logo[png]"
+ " and not test_no_circles[png]"
+ " and not test_no_gray[png]"
+ " and not test_recursive[png]"
+ " and not test_thick_lines[png]"
+ " and not test_weaklensing[png]"
+ " and not test_wordy[png]"))))
+ (propagated-inputs (list python-matplotlib python-numpy))
+ (native-inputs (list python-pytest))
+ (home-page "http://daft-pgm.org")
+ (synopsis "PGM rendering library")
+ (description "Daft is a Python package that uses matplotlib to
+render pixel-perfect probabilistic graphical models for publication in
+a journal or on the internet. With a short Python script and an
+intuitive model-building syntax you can design directed (Bayesian
+Networks, directed acyclic graphs) and undirected (Markov random fields)
+models and save them in any formats that matplotlib supports (including
+PDF, PNG, EPS and SVG).")
+ (license license:expat)))
+
(define-public python-portalocker
(package
(name "python-portalocker")
--
2.39.2
F
F
Felix Gruber wrote on 23 Jun 2023 23:12
[PATCH 2/2] gnu: Add python-pgmpy.
(address . 64258@debbugs.gnu.org)(name . Felix Gruber)(address . felgru@posteo.net)
41f25625a289da3808c54e5f80d353bb2dd41125.1687554529.git.felgru@posteo.net
* gnu/packages/statistics.scm (python-pgmpy): New variable.
---
gnu/packages/statistics.scm | 44 +++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)

Toggle diff (68 lines)
diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index e025653338..dff8f4af6b 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -18,6 +18,7 @@
;;; Copyright © 2021 Frank Pursel <frank.pursel@gmail.com>
;;; Copyright © 2022 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2023 gemmaro <gemmaro.dev@gmail.com>
+;;; Copyright © 2023 Felix Gruber <felgru@posteo.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -81,6 +82,7 @@ (define-module (gnu packages statistics)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
+ #:use-module (gnu packages python-build)
#:use-module (gnu packages python-science)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages readline)
@@ -7444,3 +7446,45 @@ (define-public ruby-enumerable-statistics
statistical summary in arrays and enumerables.")
(home-page "https://github.com/mrkn/enumerable-statistics")
(license license:expat)))
+
+(define-public python-pgmpy
+ (package
+ (name "python-pgmpy")
+ (version "0.1.22")
+ (source
+ (origin
+ (method git-fetch) ;pypi package does not include test data
+ (uri (git-reference
+ (url "https://github.com/pgmpy/pgmpy")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "03p8wbac4i4968h6639bqq0z4pg4aynhw3y28iv4l95cimgbr55i"))))
+ (build-system pyproject-build-system)
+ (propagated-inputs (list python-daft
+ python-joblib
+ python-networkx
+ python-numpy
+ python-opt-einsum
+ python-pandas
+ python-pyparsing
+ python-pytorch
+ python-scikit-learn
+ python-scipy
+ python-statsmodels
+ python-tqdm))
+ (native-inputs (list python-black
+ python-codecov
+ python-coverage
+ python-mock
+ python-pytest
+ python-pytest-cov
+ python-xdoctest))
+ (home-page "https://github.com/pgmpy/pgmpy")
+ (synopsis "Probabilistic Graphical Models library")
+ (description "This package provides a library for Probabilistic
+Graphical Models. It can be used for learning (Structure and Parameter),
+inference (Probabilistic and Causal), and simulations in Bayesian
+Networks.")
+ (license license:expat)))
--
2.39.2
F
F
Felix Gruber wrote on 4 Nov 2023 16:43
[PATCH v2 0/2] Add pgmpy library for Bayesian Networks.
(address . 64258@debbugs.gnu.org)(name . Felix Gruber)(address . felgru@posteo.net)
cover.1699112425.git.felgru@posteo.net
I've updated the patchset to pgmpy version 0.1.24.

Felix Gruber (2):
gnu: Add python-daft.
gnu: Add python-pgmpy.

gnu/packages/python-xyz.scm | 49 ++++++++++++++++++++++++++++++++++++-
gnu/packages/statistics.scm | 43 ++++++++++++++++++++++++++++++++
2 files changed, 91 insertions(+), 1 deletion(-)


base-commit: 9dcd8802f5bc472579f23a38dcf437f8a9ac976c
--
2.42.0
F
F
Felix Gruber wrote on 4 Nov 2023 16:43
[PATCH v2 1/2] gnu: Add python-daft.
(address . 64258@debbugs.gnu.org)(name . Felix Gruber)(address . felgru@posteo.net)
ad7d7f79af0291de0da5e561da18cccacc5ddaf8.1699112425.git.felgru@posteo.net
* gnu/packages/python-xyz.scm (python-daft): New variable.

Change-Id: I546556c825662e5b8bff46e5a78e7c98c8cc55ed
---
gnu/packages/python-xyz.scm | 49 ++++++++++++++++++++++++++++++++++++-
1 file changed, 48 insertions(+), 1 deletion(-)

Toggle diff (69 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index e521c1580d..1dfaa2480d 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -108,7 +108,7 @@
;;; Copyright © 2021 Simon Streit <simon@netpanic.org>
;;; Copyright © 2021, 2022, 2023 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>
;;; Copyright © 2021, 2022 Pradana Aumars <paumars@courrier.dev>
-;;; Copyright © 2021, 2022 Felix Gruber <felgru@posteo.net>
+;;; Copyright © 2021, 2022, 2023 Felix Gruber <felgru@posteo.net>
;;; Copyright © 2021 Sébastien Lerique <sl@eauchat.org>
;;; Copyright © 2021 Raphaël Mélotte <raphael.melotte@mind.be>
;;; Copyright © 2021 ZmnSCPxj <ZmnSCPxj@protonmail.com>
@@ -4157,6 +4157,53 @@ (define-public python-pomegranate
Cython for speed.")
(license license:expat)))
+(define-public python-daft
+ (package
+ (name "python-daft")
+ (version "0.1.2")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "daft" version))
+ (sha256
+ (base32
+ "1r8jsfavd624q2q61f863lk6has6mv5csswh39saafd5khwf0xry"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:test-flags
+ '(list "-k"
+ (string-append
+ ;; The following tests compare matplotlib output with
+ ;; previously generated images. They fail due to minor
+ ;; differences in where matplotlib places labels.
+ "not test_bca[png]"
+ " and not test_classic[png]"
+ " and not test_deconvolution[png]"
+ " and not test_exoplanets[png]"
+ " and not test_fixed[png]"
+ " and not test_gaia[png]"
+ " and not test_galex[png]"
+ " and not test_huey_p_newton[png]"
+ " and not test_logo[png]"
+ " and not test_no_circles[png]"
+ " and not test_no_gray[png]"
+ " and not test_recursive[png]"
+ " and not test_thick_lines[png]"
+ " and not test_weaklensing[png]"
+ " and not test_wordy[png]"))))
+ (propagated-inputs (list python-matplotlib python-numpy))
+ (native-inputs (list python-pytest))
+ (home-page "http://daft-pgm.org")
+ (synopsis "PGM rendering library")
+ (description "Daft is a Python package that uses matplotlib to
+render pixel-perfect probabilistic graphical models for publication in
+a journal or on the internet. With a short Python script and an
+intuitive model-building syntax you can design directed (Bayesian
+Networks, directed acyclic graphs) and undirected (Markov random fields)
+models and save them in any formats that matplotlib supports (including
+PDF, PNG, EPS and SVG).")
+ (license license:expat)))
+
(define-public python-portalocker
(package
(name "python-portalocker")
--
2.42.0
F
F
Felix Gruber wrote on 4 Nov 2023 16:43
[PATCH v2 2/2] gnu: Add python-pgmpy.
(address . 64258@debbugs.gnu.org)(name . Felix Gruber)(address . felgru@posteo.net)
cea70a863e005a929c2de729b459bc3b186ebb83.1699112426.git.felgru@posteo.net
* gnu/packages/statistics.scm (python-pgmpy): New variable.

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

Toggle diff (60 lines)
diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index d15732c839..d783464299 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -18,6 +18,7 @@
;;; Copyright © 2021 Frank Pursel <frank.pursel@gmail.com>
;;; Copyright © 2022 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2023 gemmaro <gemmaro.dev@gmail.com>
+;;; Copyright © 2023 Felix Gruber <felgru@posteo.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -7803,3 +7804,45 @@ (define-public ruby-enumerable-statistics
statistical summary in arrays and enumerables.")
(home-page "https://github.com/mrkn/enumerable-statistics")
(license license:expat)))
+
+(define-public python-pgmpy
+ (package
+ (name "python-pgmpy")
+ (version "0.1.24")
+ (source
+ (origin
+ (method git-fetch) ;pypi package does not include test data
+ (uri (git-reference
+ (url "https://github.com/pgmpy/pgmpy")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0fvzh6v0yhgdryczamvzhfy2ymywkh0ssx4rl47xnfvi43hnij90"))))
+ (build-system pyproject-build-system)
+ (propagated-inputs (list python-daft
+ python-joblib
+ python-networkx
+ python-numpy
+ python-opt-einsum
+ python-pandas
+ python-pyparsing
+ python-pytorch
+ python-scikit-learn
+ python-scipy
+ python-statsmodels
+ python-tqdm))
+ (native-inputs (list python-black
+ python-codecov
+ python-coverage
+ python-mock
+ python-pytest
+ python-pytest-cov
+ python-xdoctest))
+ (home-page "https://github.com/pgmpy/pgmpy")
+ (synopsis "Probabilistic Graphical Models library")
+ (description "This package provides a library for Probabilistic
+Graphical Models. It can be used for learning (Structure and Parameter),
+inference (Probabilistic and Causal), and simulations in Bayesian
+Networks.")
+ (license license:expat)))
--
2.42.0
F
F
Felix Gruber wrote on 28 Dec 2023 21:55
[PATCH v3 0/2] Add pgmpy library for Bayesian Networks.
(address . 64258@debbugs.gnu.org)(name . Felix Gruber)(address . felgru@posteo.net)
cover.1703796764.git.felgru@posteo.net
This version of the patchset fixes guix lint errors and removes
unused native-inputs from the python-pgmpy package.

Felix Gruber (2):
gnu: Add python-daft.
gnu: Add python-pgmpy.

gnu/packages/python-xyz.scm | 47 +++++++++++++++++++++++++++++++++++++
gnu/packages/statistics.scm | 38 ++++++++++++++++++++++++++++++
2 files changed, 85 insertions(+)


base-commit: 7722da6fa5422c4fec69d6c8b9536c7d6fc3d326
--
2.43.0
F
F
Felix Gruber wrote on 28 Dec 2023 21:55
[PATCH v3 1/2] gnu: Add python-daft.
(address . 64258@debbugs.gnu.org)(name . Felix Gruber)(address . felgru@posteo.net)
d5c8009e170f3df8b71c07716c6ceb8219e2befb.1703796764.git.felgru@posteo.net
* gnu/packages/python-xyz.scm (python-daft): New variable.

Change-Id: I546556c825662e5b8bff46e5a78e7c98c8cc55ed
---
gnu/packages/python-xyz.scm | 47 +++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)

Toggle diff (60 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ee689809a3..02ba55d339 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -4197,6 +4197,53 @@ (define-public python-pomegranate
Cython for speed.")
(license license:expat)))
+(define-public python-daft
+ (package
+ (name "python-daft")
+ (version "0.1.2")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "daft" version))
+ (sha256
+ (base32
+ "1r8jsfavd624q2q61f863lk6has6mv5csswh39saafd5khwf0xry"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:test-flags
+ '(list "-k"
+ (string-append
+ ;; The following tests compare matplotlib output with
+ ;; previously generated images. They fail due to minor
+ ;; differences in where matplotlib places labels.
+ "not test_bca[png]"
+ " and not test_classic[png]"
+ " and not test_deconvolution[png]"
+ " and not test_exoplanets[png]"
+ " and not test_fixed[png]"
+ " and not test_gaia[png]"
+ " and not test_galex[png]"
+ " and not test_huey_p_newton[png]"
+ " and not test_logo[png]"
+ " and not test_no_circles[png]"
+ " and not test_no_gray[png]"
+ " and not test_recursive[png]"
+ " and not test_thick_lines[png]"
+ " and not test_weaklensing[png]"
+ " and not test_wordy[png]"))))
+ (propagated-inputs (list python-matplotlib python-numpy))
+ (native-inputs (list python-pytest))
+ (home-page "https://docs.daft-pgm.org/")
+ (synopsis "PGM rendering library")
+ (description "Daft is a Python package that uses matplotlib to
+render pixel-perfect probabilistic graphical models for publication in
+a journal or on the internet. With a short Python script and an
+intuitive model-building syntax you can design directed (Bayesian
+Networks, directed acyclic graphs) and undirected (Markov random fields)
+models and save them in any formats that matplotlib supports (including
+PDF, PNG, EPS and SVG).")
+ (license license:expat)))
+
(define-public python-portalocker
(package
(name "python-portalocker")
--
2.43.0
F
F
Felix Gruber wrote on 28 Dec 2023 21:55
[PATCH v3 2/2] gnu: Add python-pgmpy.
(address . 64258@debbugs.gnu.org)(name . Felix Gruber)(address . felgru@posteo.net)
4a7f7dfaef47e3e5ff99e0344a26e890099ebcd7.1703796764.git.felgru@posteo.net
* gnu/packages/statistics.scm (python-pgmpy): New variable.

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

Toggle diff (55 lines)
diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index 0c3a560562..5fa19c4217 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -18,6 +18,7 @@
;;; Copyright © 2021 Frank Pursel <frank.pursel@gmail.com>
;;; Copyright © 2022 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2023 gemmaro <gemmaro.dev@gmail.com>
+;;; Copyright © 2023 Felix Gruber <felgru@posteo.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -7667,3 +7668,40 @@ (define-public ruby-enumerable-statistics
statistical summary in arrays and enumerables.")
(home-page "https://github.com/mrkn/enumerable-statistics")
(license license:expat)))
+
+(define-public python-pgmpy
+ (package
+ (name "python-pgmpy")
+ (version "0.1.24")
+ (source
+ (origin
+ (method git-fetch) ;pypi package does not include test data
+ (uri (git-reference
+ (url "https://github.com/pgmpy/pgmpy")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0fvzh6v0yhgdryczamvzhfy2ymywkh0ssx4rl47xnfvi43hnij90"))))
+ (build-system pyproject-build-system)
+ (propagated-inputs (list python-daft
+ python-joblib
+ python-networkx
+ python-numpy
+ python-opt-einsum
+ python-pandas
+ python-pyparsing
+ python-pytorch
+ python-scikit-learn
+ python-scipy
+ python-statsmodels
+ python-tqdm))
+ (native-inputs (list python-mock
+ python-pytest))
+ (home-page "https://github.com/pgmpy/pgmpy")
+ (synopsis "Probabilistic Graphical Models library")
+ (description "This package provides a library for Probabilistic
+Graphical Models. It can be used for learning (Structure and Parameter),
+inference (Probabilistic and Causal), and simulations in Bayesian
+Networks.")
+ (license license:expat)))
--
2.43.0
S
S
Sharlatan Hellseher wrote on 14 Feb 17:53 +0100
[PATCH 0/2] Add pgmpy library for Bayesian Networks.
(address . 64258-done@debbugs.gnu.org)
87cyszng0x.fsf@gmail.com
Hi,

Pushed as 892b4a9a02..db88f712f8 to master.

--
Oleg
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEmEeB3micIcJkGAhndtcnv/Ys0rUFAmXM8B4ACgkQdtcnv/Ys
0rUnhA//WQ2GjfX5CkjvJ1ITMHCFOOWlq8d2ry6pMB5C/xVFxwuTDRY4nKUxTqHj
wdyomVC5YR6VeAHfgAD4mhn04f7TVMqRPSRjdyjiHZnwwzK2yKdTABE11nC7gF3m
KxmNAXMjIkC0Ibf3r8SSqXTed+7wj7J2CJnwtL8Zqqb3RrKgzT72tIuVFGX+RygE
VopHqBshVOTe1u1+lPOyv2BdFkyk45Fzq0AoJvUjcYteQHKClyrxeFyRxNlWtkcb
37U7OqXD8MYpe7Jd8j+QdjmtkD3jHCbXiifIn2B/Y6YmmC8387pBXDEMdANmgh/7
4ec5vZf2sVHWbDdqOlVMdNFQJBtl7FhIznx82ZJ1Pilz+oNypf1u56GZoGqE3Ut2
AzrM3LSj6J25fL26OdngMcu4F1tTekL+EysCOQMloRsGGSfqzcZ3qN4acnc0Mek/
FXe5It31Xl7KjpqUUkmzJ5u7XzelmT61XxUczzCZC1dFNLT+8lKkyXr3czR8sKJr
WvYmgic21BT6Ths88hFpXwswnJmVqv7quDEwsC5NMtFpeDwQHcMyItJF5WIGgFkp
Tp9GWkFzNj6B0kNgrN3FpwuxzQqQIODssYeeuuOr4f7iC76WTb0Q2DZ0b8bWAEpM
XlOSZF1m+Lm/pJW58hmON2UqJl6VcWomMN36S+zqrxOYzyqoSX0=
=tKVw
-----END PGP SIGNATURE-----

Closed
?