Skip to content

Commit 58faa06

Browse files
authored
Merge pull request #82 from NeuroML/experimental
Fix for python 3.13
2 parents 406d5ce + 5679846 commit 58faa06

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
python-version: ["3.10", "3.11", "3.12"]
16+
python-version: ["3.10", "3.11", "3.12", "3.13"]
1717
env:
1818
JNML_HOME: "/home/runner/work/NeuroMLlite/NeuroMLlite/jNeuroML"
1919
HDF5_DISABLE_VERSION_CHECK: 1

examples/Example6.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,25 +111,24 @@ def generate(ref="Example6_PyNN", add_inputs=True):
111111
pop_id = "%s_%s" % (l, t)
112112
pops.append(pop_id)
113113
ref = "l%s%s" % (l[1:], t.lower())
114-
exec(
115-
ref
116-
+ " = Population(id=pop_id, size='int(%s*N_scaling)'%N_full[l][t], component=cell.id, properties={'color':color, 'type':t})"
117-
)
118-
exec("%s.random_layout = RandomLayout(region = r.id)" % ref)
119-
exec("net.populations.append(%s)" % ref)
120-
exec("pop_dict['%s'] = %s" % (pop_id, ref))
114+
d = {}
115+
d[ref] = Population(id=pop_id, size='int(%s*N_scaling)'%N_full[l][t], component=cell.id, properties={'color':color, 'type':t})
116+
117+
# Instead of exec, set the attribute directly using locals()
118+
d[ref].random_layout = RandomLayout(region=r.id)
119+
net.populations.append(d[ref])
120+
pop_dict['%s'% (pop_id)] = d[ref]
121121

122122
if add_inputs:
123123
color = ".8 .8 .8"
124124
input_id = "%s_%s_input" % (l, t)
125125
input_pops.append(input_id)
126126
input_ref = "l%s%s_i" % (l[1:], t.lower())
127-
exec(
128-
input_ref
129-
+ " = Population(id=input_id, size='int(%s*N_scaling)'%N_full[l][t], component=input_cell.id, properties={'color':color})"
130-
)
131-
exec("%s.random_layout = RandomLayout(region = r.id)" % input_ref)
132-
exec("net.populations.append(%s)" % input_ref)
127+
ir = {}
128+
ir[input_ref] = Population(id=input_id, size='int(%s*N_scaling)'%N_full[l][t], component=input_cell.id, properties={'color':color})
129+
130+
ir[input_ref].random_layout = RandomLayout(region = r.id)
131+
net.populations.append(ir[input_ref])
133132

134133
# l23i = Population(id='L23_I', size=int(100*scale), component=cell.id, properties={'color':})
135134
# l23ei = Population(id='L23_E_input', size=int(100*scale), component=input_cell.id)

examples/LEMS_SimExample3.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!--
44
5-
This LEMS file has been automatically generated using PyNeuroML v1.3.17 (libNeuroML v0.6.6)
5+
This LEMS file has been automatically generated using PyNeuroML v1.3.18 (libNeuroML v0.6.7)
66
77
-->
88

examples/LEMS_SimExample4.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!--
44
5-
This LEMS file has been automatically generated using PyNeuroML v1.3.17 (libNeuroML v0.6.6)
5+
This LEMS file has been automatically generated using PyNeuroML v1.3.18 (libNeuroML v0.6.7)
66
77
-->
88

0 commit comments

Comments
 (0)