From patchwork Sat May 20 23:12:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinicius Monego X-Patchwork-Id: 50189 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 9EF6627BBE9; Sun, 21 May 2023 00:15:13 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0E2AD27BBE2 for ; Sun, 21 May 2023 00:15:11 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q0Vn0-0008Ap-1A; Sat, 20 May 2023 19:15:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q0Vmw-0008AK-Kr for guix-patches@gnu.org; Sat, 20 May 2023 19:15:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q0Vmw-0002gZ-Bs for guix-patches@gnu.org; Sat, 20 May 2023 19:15:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q0Vmw-0000b6-80 for guix-patches@gnu.org; Sat, 20 May 2023 19:15:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63619] [PATCH 8/9] gnu: Add python-pytensor. Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 20 May 2023 23:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63619 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63619@debbugs.gnu.org Cc: Vinicius Monego Received: via spool by 63619-submit@debbugs.gnu.org id=B63619.16846244492212 (code B ref 63619); Sat, 20 May 2023 23:15:02 +0000 Received: (at 63619) by debbugs.gnu.org; 20 May 2023 23:14:09 +0000 Received: from localhost ([127.0.0.1]:59573 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q0Vm5-0000Zb-7q for submit@debbugs.gnu.org; Sat, 20 May 2023 19:14:09 -0400 Received: from mout01.posteo.de ([185.67.36.65]:41973) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q0Vm3-0000YQ-IC for 63619@debbugs.gnu.org; Sat, 20 May 2023 19:14:08 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 123F3240028 for <63619@debbugs.gnu.org>; Sun, 21 May 2023 01:14:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1684624442; bh=ok5Jcap8QeYUZ4fcjGCPY3ldgXDaemhKa7PfJCVs0QI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:From; b=mrnz4ni/cMvOZrmbGinL/BfVRw/0Qu2Y8rGxiZM678FmhQPQFympUJdNsxnZA2VvN oRtTEcW07Qn5RdpysgpIN4vAOzQ90MVzot6GIaYgTF/5zDq9Iq8ZTt55WTTqedIB+r 9XD1zt6znSWEZfzVfuOaU6mm7b/Djb1ZPROGond1hykg/rUvKf9jcvNhC/l13Hrt4Q vbge4410NdknnrczhMNtRnhy3+O5wcT3uC05AQLuKy2CABR3DXU+zvVtrYBINEAQcz /4mQt47jf+NAQL/JGdBLQ0XvuG+LLzhgPqklQZA5JZlckQPMZYbUJ147w+snxg2f54 f8f4plgt9+H0A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QNzzp3FS4z6tm4; Sun, 21 May 2023 01:13:58 +0200 (CEST) From: Vinicius Monego Date: Sat, 20 May 2023 23:12:40 +0000 Message-Id: <20230520231241.962799-8-monego@posteo.net> In-Reply-To: <20230520231241.962799-1-monego@posteo.net> References: <20230520231241.962799-1-monego@posteo.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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")