diff --git a/packages/py-pynn/package.py b/packages/py-pynn/package.py index 914d6c932e7d70530cd47478aa4b3fe9a649d322..9726f1c6a8b8f3d080eeecf40ee9d498440d8c22 100644 --- a/packages/py-pynn/package.py +++ b/packages/py-pynn/package.py @@ -15,6 +15,7 @@ class PyPynn(PythonPackage): pypi = "PyNN/PyNN-0.8.3.tar.gz" git = "https://github.com/NeuralEnsemble/PyNN.git" + version('0.9.6', sha256='d85226800e30bc1692d3f84485c3fa20b921c2ab55f1201d0a3bf23432e16cd2') version('0.9.5', sha256='91af2126b639a6a795bfc2709ac49423278c4794b6d0da143908b9afcb415f80') version('0.9.1', sha256='bbc60fea3235427191feb2daa0e2fa07eb1c3946104c068ac8a2a0501263b0b1') version('0.8.3', sha256='9d59e6cffa4714f0c892ec6b32d1f5f8f75ba3a20d8635bac50c047aa6f2537e') @@ -34,3 +35,5 @@ class PyPynn(PythonPackage): depends_on('py-lazyarray', type=('build', 'run'), when="@0.9.0:") depends_on('py-mock@1.0:', type='test') + + patch('pynn-0.9.6-python3.patch', when='@0.9.6 ^python@3:') diff --git a/packages/py-pynn/pynn-0.9.6-python3.patch b/packages/py-pynn/pynn-0.9.6-python3.patch new file mode 100644 index 0000000000000000000000000000000000000000..981ae6029f5cabb7764e8a8a9cc5b1469e3a4512 --- /dev/null +++ b/packages/py-pynn/pynn-0.9.6-python3.patch @@ -0,0 +1,40 @@ +diff --git a/pyNN/recording/files.py b/pyNN/recording/files.py +index 67c574ae..15404329 100644 +--- a/pyNN/recording/files.py ++++ b/pyNN/recording/files.py +@@ -50,7 +50,7 @@ def savez(file, *args, **kwds): + import zipfile + from numpy.lib import format + +- if isinstance(file, basestring): ++ if isinstance(file, str): + if not file.endswith('.npz'): + file = file + '.npz' + +@@ -61,7 +61,7 @@ def savez(file, *args, **kwds): + raise ValueError("Cannot use un-named variables and keyword %s" % key) + namedict[key] = val + +- zip = zipfile.ZipFile(file, mode="wb") ++ zip = zipfile.ZipFile(file, mode="w") + + # Place to write temporary .npy files + # before storing them in the zip. We need to path this to have a working +@@ -220,7 +220,7 @@ class NumpyBinaryFile(BaseFile): + def write(self, data, metadata): + __doc__ = BaseFile.write.__doc__ + self._check_open() +- metadata_array = numpy.array(metadata.items(), dtype=(str, float)) ++ metadata_array = numpy.array(list(metadata.items()), dtype=object) + savez(self.fileobj, data=data, metadata=metadata_array) + + def read(self): +@@ -234,7 +234,7 @@ class NumpyBinaryFile(BaseFile): + __doc__ = BaseFile.get_metadata.__doc__ + self._check_open() + D = {} +- for name, value in numpy.load(self.fileobj)['metadata']: ++ for name, value in numpy.load(self.fileobj, allow_pickle=True)['metadata']: + try: + D[name] = eval(value) + except Exception: diff --git a/spack.yaml b/spack.yaml index 451e6a5498b532a090701a1f420bf289a5884c3c..aefab57a3497c3b7ca831453308a4fa568d9ebb9 100644 --- a/spack.yaml +++ b/spack.yaml @@ -18,7 +18,7 @@ spack: - nest@3.0 +python +gsl +mpi %gcc@10.3.0 - arbor +mpi ^python@3:3.9 %gcc@10.3.0 - neuron +mpi %gcc@10.3.0 - - py-pynn@0.9.5 %gcc@10.3.0 + - py-pynn@0.9.6 %gcc@10.3.0 - tvb-data %gcc@10.3.0 - tvb-library ^binutils+ld+gold %gcc@10.3.0 - tvb-storage ^binutils+ld+gold %gcc@10.3.0