Skip to content

Commit cd973f3

Browse files
committed
More fixes for NEST 3.10
(we can remove the separate "Install NESTML" step once v8.3.0 is released on PyPI)
1 parent 070097e commit cd973f3

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/full-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ jobs:
5959
if: startsWith(matrix.os, 'ubuntu')
6060
run: |
6161
python -m pip install arbor==0.9.0 libNeuroML morphio
62+
- name: Install NESTML
63+
if: startsWith(matrix.os, 'ubuntu')
64+
run: |
65+
python -m pip install https://github.com/nest/nestml/archive/refs/tags/v8.3.0-rc2.tar.gz
6266
- name: Install PyNN itself
6367
run: |
6468
python -m pip install -e ".[test,nestml]"

pyNN/nest/projections.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,11 +495,17 @@ def _get_attributes_as_arrays(self, names, multiple_synapses='sum'):
495495
value_arr = np.nan * np.ones((self.pre.size, self.post.size))
496496
connection_attributes = nest.GetStatus(self.nest_connections,
497497
('source', 'target', attribute_name))
498-
# NEST 3.10 returns a dict {key: [values]}; earlier versions return a list of tuples
498+
# GetStatus return format varies by NEST version:
499+
# dict {key: [values]} — seen in some NEST 3.x builds
500+
# list of dicts — NEST 3.10rc1
501+
# list of tuples — older NEST
499502
if isinstance(connection_attributes, dict):
500503
conn_iter = zip(connection_attributes['source'],
501504
connection_attributes['target'],
502505
connection_attributes[attribute_name])
506+
elif connection_attributes and isinstance(connection_attributes[0], dict):
507+
conn_iter = ((c['source'], c['target'], c[attribute_name])
508+
for c in connection_attributes)
503509
else:
504510
conn_iter = connection_attributes
505511
for conn in conn_iter:

0 commit comments

Comments
 (0)