summaryrefslogtreecommitdiff
path: root/gnu/packages/machine-learning.scm
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2023-03-19 11:33:52 +0100
committerLars-Dominik Braun <lars@6xq.net>2023-03-19 11:33:52 +0100
commitf9702aa9fdfded5c62da43197f8cea5eeba30803 (patch)
treeb6bde95b925d151fb8c1b17d56f4babd441c6a67 /gnu/packages/machine-learning.scm
parentc16add7fd9783db46bb5b308a885af62f0299e61 (diff)
gnu: Add python-brian2.
* gnu/packages/machine-learning.scm (python-brian2): New variable.
Diffstat (limited to 'gnu/packages/machine-learning.scm')
-rw-r--r--gnu/packages/machine-learning.scm42
1 files changed, 42 insertions, 0 deletions
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)))