Skip to content

Commit 43c77c1

Browse files
katdueckerasoplata
authored andcommitted
fix: add missing "v" read-in (with back-compat)
This also includes regenerated networks, since doing that is necessary to allow the tests to pass as well. The original person who actually wrote this code was @katduecker, which is why they are indicated as author. This version of the code that was extracted from jonescompneurolab#1168 was done so by @asoplata .
1 parent b8953da commit 43c77c1

File tree

3 files changed

+57
-7
lines changed

3 files changed

+57
-7
lines changed

hnn_core/hnn_io.py

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,25 @@ def _read_cell_types(cell_types_data):
166166
sections_data = cell_data["sections"]
167167
for section_name in sections_data:
168168
section_data = sections_data[section_name]
169-
sections[section_name] = Section(
170-
L=section_data["L"],
171-
diam=section_data["diam"],
172-
cm=section_data["cm"],
173-
Ra=section_data["Ra"],
174-
end_pts=section_data["end_pts"],
175-
)
169+
if "v" in section_data.keys():
170+
sections[section_name] = Section(
171+
L=section_data["L"],
172+
diam=section_data["diam"],
173+
cm=section_data["cm"],
174+
Ra=section_data["Ra"],
175+
v=section_data["v"],
176+
end_pts=section_data["end_pts"],
177+
)
178+
else:
179+
# Yet more legacy backwards-compatibility
180+
sections[section_name] = Section(
181+
L=section_data["L"],
182+
diam=section_data["diam"],
183+
cm=section_data["cm"],
184+
Ra=section_data["Ra"],
185+
end_pts=section_data["end_pts"],
186+
)
187+
176188
# Set section attributes
177189
sections[section_name].syns = section_data["syns"]
178190
sections[section_name].mechs = section_data["mechs"]

hnn_core/param/jones2009_base.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
]
3333
],
3434
"nseg": 1,
35+
"v": -65,
3536
"mechs": {
3637
"hh2": {}
3738
},
@@ -110,6 +111,7 @@
110111
]
111112
],
112113
"nseg": 1,
114+
"v": -71.46,
113115
"mechs": {
114116
"km": {
115117
"gbar_km": 250.0
@@ -146,6 +148,7 @@
146148
]
147149
],
148150
"nseg": 7,
151+
"v": -71.46,
149152
"mechs": {
150153
"km": {
151154
"gbar_km": 250.0
@@ -182,6 +185,7 @@
182185
]
183186
],
184187
"nseg": 5,
188+
"v": -71.46,
185189
"mechs": {
186190
"km": {
187191
"gbar_km": 250.0
@@ -218,6 +222,7 @@
218222
]
219223
],
220224
"nseg": 7,
225+
"v": -71.46,
221226
"mechs": {
222227
"km": {
223228
"gbar_km": 250.0
@@ -254,6 +259,7 @@
254259
]
255260
],
256261
"nseg": 1,
262+
"v": -71.46,
257263
"mechs": {
258264
"km": {
259265
"gbar_km": 250.0
@@ -290,6 +296,7 @@
290296
]
291297
],
292298
"nseg": 5,
299+
"v": -71.46,
293300
"mechs": {
294301
"km": {
295302
"gbar_km": 250.0
@@ -326,6 +333,7 @@
326333
]
327334
],
328335
"nseg": 5,
336+
"v": -71.46,
329337
"mechs": {
330338
"km": {
331339
"gbar_km": 250.0
@@ -362,6 +370,7 @@
362370
]
363371
],
364372
"nseg": 1,
373+
"v": -65,
365374
"mechs": {
366375
"km": {
367376
"gbar_km": 250.0
@@ -494,6 +503,7 @@
494503
]
495504
],
496505
"nseg": 1,
506+
"v": -65,
497507
"mechs": {
498508
"hh2": {}
499509
},
@@ -570,6 +580,7 @@
570580
]
571581
],
572582
"nseg": 3,
583+
"v": -72,
573584
"mechs": {
574585
"hh2": {
575586
"gkbar_hh2": 0.01,
@@ -632,6 +643,7 @@
632643
]
633644
],
634645
"nseg": 13,
646+
"v": -71.32,
635647
"mechs": {
636648
"hh2": {
637649
"gkbar_hh2": 0.01,
@@ -714,6 +726,7 @@
714726
]
715727
],
716728
"nseg": 13,
729+
"v": -69.08,
717730
"mechs": {
718731
"hh2": {
719732
"gkbar_hh2": 0.01,
@@ -796,6 +809,7 @@
796809
]
797810
],
798811
"nseg": 9,
812+
"v": -67.3,
799813
"mechs": {
800814
"hh2": {
801815
"gkbar_hh2": 0.01,
@@ -870,6 +884,7 @@
870884
]
871885
],
872886
"nseg": 5,
887+
"v": -72,
873888
"mechs": {
874889
"hh2": {
875890
"gkbar_hh2": 0.01,
@@ -936,6 +951,7 @@
936951
]
937952
],
938953
"nseg": 1,
954+
"v": -72,
939955
"mechs": {
940956
"hh2": {
941957
"gkbar_hh2": 0.01,
@@ -994,6 +1010,7 @@
9941010
]
9951011
],
9961012
"nseg": 5,
1013+
"v": -72,
9971014
"mechs": {
9981015
"hh2": {
9991016
"gkbar_hh2": 0.01,
@@ -1060,6 +1077,7 @@
10601077
]
10611078
],
10621079
"nseg": 5,
1080+
"v": -72,
10631081
"mechs": {
10641082
"hh2": {
10651083
"gkbar_hh2": 0.01,
@@ -1126,6 +1144,7 @@
11261144
]
11271145
],
11281146
"nseg": 1,
1147+
"v": -72,
11291148
"mechs": {
11301149
"hh2": {
11311150
"gkbar_hh2": 0.01,

hnn_core/tests/assets/jones2009_3x3_drives.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
]
3333
],
3434
"nseg": 1,
35+
"v": -65,
3536
"mechs": {
3637
"hh2": {}
3738
},
@@ -110,6 +111,7 @@
110111
]
111112
],
112113
"nseg": 1,
114+
"v": -71.46,
113115
"mechs": {
114116
"km": {
115117
"gbar_km": 250.0
@@ -146,6 +148,7 @@
146148
]
147149
],
148150
"nseg": 7,
151+
"v": -71.46,
149152
"mechs": {
150153
"km": {
151154
"gbar_km": 250.0
@@ -182,6 +185,7 @@
182185
]
183186
],
184187
"nseg": 5,
188+
"v": -71.46,
185189
"mechs": {
186190
"km": {
187191
"gbar_km": 250.0
@@ -218,6 +222,7 @@
218222
]
219223
],
220224
"nseg": 7,
225+
"v": -71.46,
221226
"mechs": {
222227
"km": {
223228
"gbar_km": 250.0
@@ -254,6 +259,7 @@
254259
]
255260
],
256261
"nseg": 1,
262+
"v": -71.46,
257263
"mechs": {
258264
"km": {
259265
"gbar_km": 250.0
@@ -290,6 +296,7 @@
290296
]
291297
],
292298
"nseg": 5,
299+
"v": -71.46,
293300
"mechs": {
294301
"km": {
295302
"gbar_km": 250.0
@@ -326,6 +333,7 @@
326333
]
327334
],
328335
"nseg": 5,
336+
"v": -71.46,
329337
"mechs": {
330338
"km": {
331339
"gbar_km": 250.0
@@ -362,6 +370,7 @@
362370
]
363371
],
364372
"nseg": 1,
373+
"v": -65,
365374
"mechs": {
366375
"km": {
367376
"gbar_km": 250.0
@@ -494,6 +503,7 @@
494503
]
495504
],
496505
"nseg": 1,
506+
"v": -65,
497507
"mechs": {
498508
"hh2": {}
499509
},
@@ -570,6 +580,7 @@
570580
]
571581
],
572582
"nseg": 3,
583+
"v": -72,
573584
"mechs": {
574585
"hh2": {
575586
"gkbar_hh2": 0.01,
@@ -632,6 +643,7 @@
632643
]
633644
],
634645
"nseg": 13,
646+
"v": -71.32,
635647
"mechs": {
636648
"hh2": {
637649
"gkbar_hh2": 0.01,
@@ -714,6 +726,7 @@
714726
]
715727
],
716728
"nseg": 13,
729+
"v": -69.08,
717730
"mechs": {
718731
"hh2": {
719732
"gkbar_hh2": 0.01,
@@ -796,6 +809,7 @@
796809
]
797810
],
798811
"nseg": 9,
812+
"v": -67.3,
799813
"mechs": {
800814
"hh2": {
801815
"gkbar_hh2": 0.01,
@@ -870,6 +884,7 @@
870884
]
871885
],
872886
"nseg": 5,
887+
"v": -72,
873888
"mechs": {
874889
"hh2": {
875890
"gkbar_hh2": 0.01,
@@ -936,6 +951,7 @@
936951
]
937952
],
938953
"nseg": 1,
954+
"v": -72,
939955
"mechs": {
940956
"hh2": {
941957
"gkbar_hh2": 0.01,
@@ -994,6 +1010,7 @@
9941010
]
9951011
],
9961012
"nseg": 5,
1013+
"v": -72,
9971014
"mechs": {
9981015
"hh2": {
9991016
"gkbar_hh2": 0.01,
@@ -1060,6 +1077,7 @@
10601077
]
10611078
],
10621079
"nseg": 5,
1080+
"v": -72,
10631081
"mechs": {
10641082
"hh2": {
10651083
"gkbar_hh2": 0.01,
@@ -1126,6 +1144,7 @@
11261144
]
11271145
],
11281146
"nseg": 1,
1147+
"v": -72,
11291148
"mechs": {
11301149
"hh2": {
11311150
"gkbar_hh2": 0.01,

0 commit comments

Comments
 (0)