From 80e30222e1bc166ff40e50d50570c2a86b9918f8 Mon Sep 17 00:00:00 2001 From: Erik Heeren Date: Wed, 14 Dec 2022 19:00:26 +0100 Subject: New neuroscience packages: py-bmtk, py-neurotools (#34464) * Add py-bmtk and py-neurotools * py-bmtk: version bump * [@spackbot] updating style on behalf of heerener * Maybe the copyright needs to be extended to 2022 for the check to pass * Process review remarks * Update var/spack/repos/builtin/packages/py-neurotools/package.py Co-authored-by: Adam J. Stewart Co-authored-by: Adam J. Stewart --- .../repos/builtin/packages/py-bmtk/package.py | 28 ++++++++++++++++++++++ .../packages/py-neurotools/neurotools-0.3.1.patch | 22 +++++++++++++++++ .../builtin/packages/py-neurotools/package.py | 25 +++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 var/spack/repos/builtin/packages/py-bmtk/package.py create mode 100644 var/spack/repos/builtin/packages/py-neurotools/neurotools-0.3.1.patch create mode 100644 var/spack/repos/builtin/packages/py-neurotools/package.py diff --git a/var/spack/repos/builtin/packages/py-bmtk/package.py b/var/spack/repos/builtin/packages/py-bmtk/package.py new file mode 100644 index 0000000000..f3dc57b644 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-bmtk/package.py @@ -0,0 +1,28 @@ +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyBmtk(PythonPackage): + """The Brain Modeling Toolkit""" + + homepage = "https://github.com/AllenInstitute/bmtk" + pypi = "bmtk/bmtk-1.0.5.tar.gz" + + version("1.0.7", sha256="11e85098cf3c940a3d64718645f4a24ee13c8a47438ef5d28e054cb27ee01702") + version("1.0.5", sha256="e0cb47b334467a6d124cfb99bbc67cc88f39f0291f4c39929f50d153130642a4") + + depends_on("py-setuptools", type="build") + + depends_on("py-jsonschema", type=("build", "run")) + depends_on("py-pandas", type=("build", "run")) + depends_on("py-numpy", type=("build", "run")) + depends_on("py-six", type=("build", "run")) + depends_on("py-h5py", type=("build", "run")) + depends_on("py-matplotlib", type=("build", "run")) + depends_on("py-scipy", type=("build", "run")) + depends_on("py-scikit-image", type=("build", "run")) + depends_on("py-sympy", type=("build", "run")) diff --git a/var/spack/repos/builtin/packages/py-neurotools/neurotools-0.3.1.patch b/var/spack/repos/builtin/packages/py-neurotools/neurotools-0.3.1.patch new file mode 100644 index 0000000000..2f9d73ff19 --- /dev/null +++ b/var/spack/repos/builtin/packages/py-neurotools/neurotools-0.3.1.patch @@ -0,0 +1,22 @@ +diff --git a/src/stgen.py b/src/stgen.py +index b818ea5..3cb45e6 100644 +--- a/src/stgen.py ++++ b/src/stgen.py +@@ -227,7 +227,7 @@ class StGen: + number = min(5+numpy.ceil(2*n),100) + + if number > 0: +- isi = self.rng.exponential(1.0/rate, number)*1000.0 ++ isi = self.rng.exponential(1.0/rate, int(number)) * 1000.0 + if number > 1: + spikes = numpy.add.accumulate(isi) + else: +@@ -301,7 +301,7 @@ class StGen: + number = min(5+numpy.ceil(2*n),100) + + if number > 0: +- isi = self.rng.gamma(a, b, number)*1000.0 ++ isi = self.rng.gamma(a, b, int(number))*1000.0 + if number > 1: + spikes = numpy.add.accumulate(isi) + else: diff --git a/var/spack/repos/builtin/packages/py-neurotools/package.py b/var/spack/repos/builtin/packages/py-neurotools/package.py new file mode 100644 index 0000000000..dc37019d6e --- /dev/null +++ b/var/spack/repos/builtin/packages/py-neurotools/package.py @@ -0,0 +1,25 @@ +# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class PyNeurotools(PythonPackage): + """A collection of tools for representing and anlyzing neuroscientific + data.""" + + homepage = "http://neuralensemble.org/NeuroTools" + pypi = "neurotools/NeuroTools-0.3.1.tar.gz" + + version("0.3.1", sha256="a459420fc0e9ff6b59af28716ddb0c75d11a63b8db80a5f4844e0d7a90c2c653") + + depends_on("py-setuptools", type="build") + depends_on("py-scipy", type=("build", "run")) + depends_on("py-numpy", type=("build", "run")) + depends_on("py-matplotlib", type=("build", "run")) + depends_on("py-tables", type=("build", "run")) + depends_on("py-pyaml", type=("build", "run")) + + patch("neurotools-0.3.1.patch", when="@0.3.1") -- cgit v1.2.3-70-g09d2