diff --git a/packages/py-pynn/package.py b/packages/py-pynn/package.py index 402d05099e70dc5476fec69de07c1d96a497446f..a05d062de970ccd24591976828a92d7b6bce05b8 100644 --- a/packages/py-pynn/package.py +++ b/packages/py-pynn/package.py @@ -61,6 +61,7 @@ class PyPynn(PythonPackage): depends_on("py-pytest", type='test', when="@0.11.0:") patch('pynn-0.9.6-python3.patch', when='@0.9.6 ^python@3:') + patch('pynn-numpy-1.24.patch', when='@0.9.6: ^py-numpy@1.24:') # neuroml and nineml are optional dependencies. Leave out of import_modules to avoid errors in tests skip_modules = ['pyNN.neuroml', 'pyNN.nineml', 'pyNN.hardware'] diff --git a/packages/py-pynn/pynn-numpy-1.24.patch b/packages/py-pynn/pynn-numpy-1.24.patch new file mode 100644 index 0000000000000000000000000000000000000000..eefbf9ab6171d5dde28bbf914885103c3f850d32 --- /dev/null +++ b/packages/py-pynn/pynn-numpy-1.24.patch @@ -0,0 +1,15 @@ +diff --git a/pyNN/brian2/projections.py b/pyNN/brian2/projections.py +index 9fad3b9e..89f98dcf 100644 +--- a/pyNN/brian2/projections.py ++++ b/pyNN/brian2/projections.py +@@ -169,8 +169,8 @@ class Projection(common.Projection): + if isinstance(self.pre, common.Assembly): + boundaries = np.cumsum([0] + [p.size for p in self.pre.populations]) + assert indices.max() < boundaries[-1] +- partitions = np.split(indices, np.searchsorted( +- indices, boundaries[1:-1])) - boundaries[:-1] ++ partitions = np.array(np.split(indices, np.searchsorted( ++ indices, boundaries[1:-1])), dtype=object) - boundaries[:-1] + for i_group, local_indices in enumerate(partitions): + if isinstance(self.pre.populations[i_group], common.PopulationView): + partitions[i_group] = self.pre.populations[i_group].index_in_grandparent(