guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: gnu: Add python-brian2.


From: guix-commits
Subject: 02/02: gnu: Add python-brian2.
Date: Sun, 19 Mar 2023 06:48:15 -0400 (EDT)

lbraun pushed a commit to branch master
in repository guix.

commit f9702aa9fdfded5c62da43197f8cea5eeba30803
Author: Lars-Dominik Braun <lars@6xq.net>
AuthorDate: Sun Mar 19 11:33:52 2023 +0100

    gnu: Add python-brian2.
    
    * gnu/packages/machine-learning.scm (python-brian2): New variable.
---
 gnu/packages/machine-learning.scm | 42 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/gnu/packages/machine-learning.scm 
b/gnu/packages/machine-learning.scm
index 8bd1d8b8bb..004568a77b 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -3816,3 +3816,45 @@ fi"
                         original-exe
                         original-exe)))
             (chmod exe #o555)))))))
+
+(define-public python-brian2
+  (package
+    (name "python-brian2")
+    (version "2.5.1")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "Brian2" version))
+              (sha256
+               (base32
+                "1g48hzn3cdsvfjgz64s3kvh5d5287ggjxdyacb7wh2n5nd5iqlf7"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (setenv "HOME" "/tmp")
+               ;; Must be run in a different directory, otherwise compiled
+               ;; modules are not found.
+               (with-directory-excursion "/tmp"
+                 ;; Invoking brian2.test() is preferred to running pytest.
+                 (invoke "python" "-c"
+                  "import brian2, sys; sys.exit(0 if brian2.test() else 
1)"))))))))
+    (propagated-inputs (list python-cython ; Required by codegen.
+                             python-jinja2
+                             python-numpy
+                             python-py-cpuinfo
+                             python-pyparsing
+                             ;; Required by codegen.
+                             python-setuptools
+                             python-sympy))
+    (native-inputs (list python-pytest python-pytest-xdist))
+    (home-page "https://briansimulator.org/";)
+    (synopsis "Clock-driven simulator for spiking neural networks")
+    (description
+     "Brian is a simulator for spiking neural networks written in Python.  It
+is therefore designed to be easy to learn and use, highly flexible and
+easily extensible.")
+    (license license:cecill)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]