test failure on py3.12: `ValueError: ...`
sanjayankur31 opened this issue · comments
Fedora is testing all our Python packages in preparation for Python 3.12. I'm seeing this one failure with PyNN 0.11.0:
platform linux -- Python 3.12.0b4, pytest-7.3.2, pluggy-1.0.0
...
=================================== FAILURES ===================================
_______________________ TestProjection.test_partitioning _______________________
self = <unittests.test_brian.TestProjection testMethod=test_partitioning>
def test_partitioning(self):
p1 = sim.Population(5, sim.IF_cond_exp())
p2 = sim.Population(7, sim.IF_cond_exp()) a = p1 + p2[1:4] # [0 2 3 4 5][x 1 2 3 x x x] prj = sim.Projection(a, a, MockConnector(), synapse_type=self.syn) presynaptic_indices = np.array([0, 3, 4, 6, 7]) > partitions = prj._partition(presynaptic_indices)
test/unittests/test_brian.py:38:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Projection("assembly56→assembly56"), indices = array([0, 3, 4, 6, 7])
def _partition(self, indices):
"""
partition indices, in case of Assemblies
"""
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]
E ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogene
ous part.
../../BUILDROOT/python-pynn-0.11.0-2.fc39.x86_64/usr/lib/python3.12/site-packages/pyNN/brian2/projections.py:172: ValueError
Could be a numpy or brian2 related thing? Not sure yet. Complete build log attached:
pynn-0.11.0-buildlog.txt
I don't know if GH actions support py3.12 yet, but if they do, probably worth enabling py3.11 and 3.12 there too?
fixed in e791f6c