unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Vinicius Monego <monego@posteo.net>
To: 63619@debbugs.gnu.org
Cc: Vinicius Monego <monego@posteo.net>
Subject: [bug#63619] [PATCH 8/9] gnu: Add python-pytensor.
Date: Sat, 20 May 2023 23:12:40 +0000	[thread overview]
Message-ID: <20230520231241.962799-8-monego@posteo.net> (raw)
In-Reply-To: <20230520231241.962799-1-monego@posteo.net>

* gnu/packages/python-science.scm (python-pytensor): New variable.
---
 gnu/packages/python-science.scm | 78 +++++++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index d076c877fc..a419f4d023 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -754,6 +754,84 @@ (define-public python-xarray-einstats
 functions and around einops with an API and features adapted to xarray.")
     (license license:asl2.0)))
 
+(define-public python-pytensor
+  (package
+    (name "python-pytensor")
+    (version "2.11.3")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/pymc-devs/pytensor")
+                    (commit (string-append "rel-" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1qg38jv1244v5lzjgnb116jpz1gj8p3c5pjxr2nvkx7qpjwzxvk6"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list #:phases #~(modify-phases %standard-phases
+                        (add-after 'unpack 'write-permissions
+                          (lambda _
+                            (setenv "HOME" "/tmp")))
+                        (add-after 'unpack 'versioneer
+                          (lambda _
+                            ;; Our version of versioneer needs setup.cfg.
+                            ;; This is adapted from pyproject.toml.
+                            (with-output-to-file "setup.cfg"
+                              (lambda ()
+                                (display
+                                 "[versioneer]
+VCS = git
+style = pep440
+versionfile_source = pytensor/_version.py
+versionfile_build = pytensor/_version.py
+tag_prefix = rel-
+")))
+                            (invoke "versioneer" "install")
+                            (substitute* "setup.py"
+                              (("versioneer.get_version\\(\\)")
+                               (string-append "\""
+                                              #$version "\"")))))
+                        (replace 'check
+                          (lambda* (#:key tests? #:allow-other-keys)
+                            (when tests?
+                              ;; Test discovery fails, have to call pytest by hand
+                              ;; test_tensor_basic.py file requires JAX.
+                              (invoke "python" "-m" "pytest" "-vv"
+                                      "--ignore"
+                                      "tests/link/jax/test_tensor_basic.py"
+                                      ;; Skip benchmark tests.
+                                      "-k"
+                                      (string-append "not test_elemwise_speed"
+                                       " and not test_logsumexp_benchmark"
+                                       " and not test_fused_elemwise_benchmark"
+                                       " and not test_scan_multiple_output"
+                                       " and not test_vector_taps_benchmark"
+                                       " and not test_cython_performance")
+                                      ;; Skip computationally intensive tests.
+                                      "--ignore" "tests/scan/"
+                                      "--ignore" "tests/tensor/"
+                                      "--ignore" "tests/sandbox/"
+                                      "--ignore" "tests/sparse/sandbox/")))))))
+    (native-inputs (list python-cython python-pytest python-versioneer))
+    (propagated-inputs (list python-cons
+                             python-etuples
+                             python-filelock
+                             python-logical-unification
+                             python-minikanren
+                             python-numba
+                             python-numpy
+                             python-scipy
+                             python-typing-extensions))
+    (home-page "https://pytensor.readthedocs.io/en/latest/")
+    (synopsis
+     "Library for mathematical expressions in multi-dimensional arrays")
+    (description
+     "PyTensor is a Python library that allows one to define,
+optimize, and efficiently evaluate mathematical expressions involving
+multi-dimensional arrays.  It is a fork of the Aesara library.")
+    (license license:bsd-3)))
+
 (define-public python-msgpack-numpy
   (package
     (name "python-msgpack-numpy")
-- 
2.34.1





  parent reply	other threads:[~2023-05-20 23:15 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-20 23:10 [bug#63619] [PATCH 0/9] Add PyMC Vinicius Monego
2023-05-20 23:12 ` [bug#63619] [PATCH 1/9] gnu: Add python-vega-datasets Vinicius Monego
2023-05-20 23:12   ` [bug#63619] [PATCH 2/9] gnu: Add python-altair Vinicius Monego
2023-05-20 23:12   ` [bug#63619] [PATCH 3/9] gnu: Add python-einops Vinicius Monego
2023-05-20 23:12   ` [bug#63619] [PATCH 4/9] gnu: python-xarray: Update to 2023.5.0 Vinicius Monego
2023-05-20 23:12   ` [bug#63619] [PATCH 5/9] gnu: Add python-xarray-einstats Vinicius Monego
2023-05-20 23:12   ` [bug#63619] [PATCH 6/9] gnu: Add python-arviz Vinicius Monego
2023-05-20 23:12   ` [bug#63619] [PATCH 7/9] gnu: Add python-fastprogress Vinicius Monego
2023-05-20 23:12   ` Vinicius Monego [this message]
2023-05-20 23:12   ` [bug#63619] [PATCH 9/9] gnu: Add python-pymc Vinicius Monego
2023-06-05 13:01 ` [bug#63619] [PATCH 0/9] Add PyMC Ludovic Courtès
2023-06-09  4:10   ` Vinicius Monego
2023-06-14 21:05     ` Ludovic Courtès
2023-06-14 22:46       ` Vinicius Monego
2023-06-21 21:48         ` Ludovic Courtès
2023-06-25 14:01           ` bug#63619: " Vinicius Monego
2023-06-09  3:49 ` [bug#63619] [PATCH v2 1/9] gnu: Add python-vega-datasets Vinicius Monego
2023-06-09  3:49   ` [bug#63619] [PATCH v2 2/9] gnu: Add python-altair Vinicius Monego
2023-06-09  3:49   ` [bug#63619] [PATCH v2 3/9] gnu: Add python-einops Vinicius Monego
2023-06-09  3:49   ` [bug#63619] [PATCH v2 4/9] gnu: python-xarray: Update to 2023.5.0 Vinicius Monego
2023-06-09  3:49   ` [bug#63619] [PATCH v2 5/9] gnu: Add python-xarray-einstats Vinicius Monego
2023-06-09  3:49   ` [bug#63619] [PATCH v2 6/9] gnu: Add python-arviz Vinicius Monego
2023-06-09  3:49   ` [bug#63619] [PATCH v2 7/9] gnu: Add python-fastprogress Vinicius Monego
2023-06-09  3:49   ` [bug#63619] [PATCH v2 8/9] gnu: Add python-pytensor Vinicius Monego
2023-06-09  3:49   ` [bug#63619] [PATCH v2 9/9] gnu: Add python-pymc Vinicius Monego

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230520231241.962799-8-monego@posteo.net \
    --to=monego@posteo.net \
    --cc=63619@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).