@@ -178,6 +178,8 @@ def test_info(self):
178
178
"""Test getting member info."""
179
179
cell = neuroml .Cell (id = "testcell" )
180
180
cell .set_spike_thresh ("40mV" )
181
+ cell .set_init_memb_potential ("-70mV" )
182
+ cell .set_specific_capacitance ("1 uF_per_cm2" )
181
183
info = cell .info ()
182
184
self .assertRegex (info , "morphology" )
183
185
self .assertRegex (info , "biophysical_properties" )
@@ -214,6 +216,8 @@ def test_parentinfo(self):
214
216
"""Test the parent info method"""
215
217
cell = neuroml .Cell (id = "testcell" )
216
218
cell .set_spike_thresh ("40mV" )
219
+ cell .set_init_memb_potential ("-70mV" )
220
+ cell .set_specific_capacitance ("1 uF_per_cm2" )
217
221
info = cell .parentinfo ()
218
222
self .assertRegex (info , "NeuroMLDocument" )
219
223
@@ -240,6 +244,8 @@ def test_add_segment(self):
240
244
"""Test adding a segment."""
241
245
new_cell = component_factory ("Cell" , id = "test_cell" )
242
246
new_cell .set_spike_thresh ("40mV" )
247
+ new_cell .set_init_memb_potential ("-70mV" )
248
+ new_cell .set_specific_capacitance ("1 uF_per_cm2" )
243
249
segment = new_cell .add_segment (
244
250
(0 , 0 , 0 , 20 ),
245
251
(20 , 0 , 0 , 20 ),
@@ -259,6 +265,8 @@ def test_add_segment_no_group(self):
259
265
"""Test adding a segment but without a group."""
260
266
new_cell = component_factory ("Cell" , id = "test_cell" )
261
267
new_cell .set_spike_thresh ("40mV" )
268
+ new_cell .set_init_memb_potential ("-70mV" )
269
+ new_cell .set_specific_capacitance ("1 uF_per_cm2" )
262
270
segment = new_cell .add_segment (
263
271
(0 , 0 , 0 , 20 ), (20 , 0 , 0 , 20 ), name = "soma" , group_id = None , seg_type = "soma"
264
272
)
@@ -274,6 +282,7 @@ def test_setting_init_memb_potential(self):
274
282
"""Test adding initial membrane potential."""
275
283
new_cell = component_factory ("Cell" , id = "test_cell" )
276
284
new_cell .set_spike_thresh ("40mV" )
285
+ new_cell .set_specific_capacitance ("1 uF_per_cm2" )
277
286
new_cell .add_segment (
278
287
(0 , 0 , 0 , 20 ),
279
288
(20 , 0 , 0 , 20 ),
@@ -296,6 +305,8 @@ def test_setting_spike_thresh(self):
296
305
seg_type = "soma" ,
297
306
)
298
307
new_cell .set_spike_thresh ("40mV" )
308
+ new_cell .set_init_memb_potential ("-70mV" )
309
+ new_cell .set_specific_capacitance ("1 uF_per_cm2" )
299
310
300
311
self .assertIsNone (new_cell .validate (True ))
301
312
@@ -327,6 +338,8 @@ def test_setting_resistivity(self):
327
338
)
328
339
new_cell .set_resistivity ("2000 ohm_cm" )
329
340
new_cell .set_spike_thresh ("40mV" )
341
+ new_cell .set_init_memb_potential ("-70mV" )
342
+ new_cell .set_specific_capacitance ("1 uF_per_cm2" )
330
343
self .assertIsNone (new_cell .validate (True ))
331
344
332
345
@unittest .expectedFailure
@@ -347,6 +360,8 @@ def test_setting_specific_capacitance(self):
347
360
"""Test setting the specific_capacitance."""
348
361
new_cell = component_factory ("Cell" , id = "test_cell" )
349
362
new_cell .set_spike_thresh ("40mV" )
363
+ new_cell .set_init_memb_potential ("-70mV" )
364
+ new_cell .set_specific_capacitance ("1 uF_per_cm2" )
350
365
new_cell .add_segment (
351
366
(0 , 0 , 0 , 20 ),
352
367
(20 , 0 , 0 , 20 ),
@@ -362,6 +377,8 @@ def test_setting_specific_capacitance_should_fail(self):
362
377
"""Test setting the specific_capacitance."""
363
378
new_cell = component_factory ("Cell" , id = "test_cell" )
364
379
new_cell .set_spike_thresh ("40mV" )
380
+ new_cell .set_init_memb_potential ("-70mV" )
381
+ new_cell .set_specific_capacitance ("1 uF_per_cm2" )
365
382
new_cell .add_segment (
366
383
(0 , 0 , 0 , 20 ),
367
384
(20 , 0 , 0 , 20 ),
@@ -376,6 +393,8 @@ def test_setting_channel_density(self):
376
393
"""Test setting the channel_density."""
377
394
new_cell = component_factory ("Cell" , id = "test_cell" )
378
395
new_cell .set_spike_thresh ("40mV" )
396
+ new_cell .set_init_memb_potential ("-70mV" )
397
+ new_cell .set_specific_capacitance ("1 uF_per_cm2" )
379
398
new_cell .add_segment (
380
399
(0 , 0 , 0 , 20 ),
381
400
(20 , 0 , 0 , 20 ),
@@ -421,6 +440,8 @@ def test_setting_channel_density_v(self):
421
440
"""Test setting the channel_density."""
422
441
new_cell = component_factory ("Cell" , id = "test_cell" )
423
442
new_cell .set_spike_thresh ("40mV" )
443
+ new_cell .set_init_memb_potential ("-70mV" )
444
+ new_cell .set_specific_capacitance ("1 uF_per_cm2" )
424
445
new_cell .add_segment (
425
446
(0 , 0 , 0 , 20 ),
426
447
(20 , 0 , 0 , 20 ),
@@ -469,6 +490,8 @@ def test_setting_channel_density_should_fail(self):
469
490
"""Test setting the channel_density."""
470
491
new_cell = component_factory ("Cell" , id = "test_cell" )
471
492
new_cell .set_spike_thresh ("40mV" )
493
+ new_cell .set_init_memb_potential ("-70mV" )
494
+ new_cell .set_specific_capacitance ("1 uF_per_cm2" )
472
495
new_cell .add_segment (
473
496
(0 , 0 , 0 , 20 ),
474
497
(20 , 0 , 0 , 20 ),
@@ -502,6 +525,7 @@ def test_setting_membrane_property(self):
502
525
"""Test adding a new membrane property"""
503
526
new_cell = component_factory ("Cell" , id = "test_cell" )
504
527
new_cell .set_spike_thresh ("40mV" )
528
+ new_cell .set_specific_capacitance ("1 uF_per_cm2" )
505
529
new_cell .add_segment (
506
530
(0 , 0 , 0 , 20 ),
507
531
(20 , 0 , 0 , 20 ),
@@ -524,6 +548,8 @@ def test_setting_intracellular_property(self):
524
548
"""Test adding a new membrane property"""
525
549
new_cell = component_factory ("Cell" , id = "test_cell" )
526
550
new_cell .set_spike_thresh ("40mV" )
551
+ new_cell .set_init_memb_potential ("-70mV" )
552
+ new_cell .set_specific_capacitance ("1 uF_per_cm2" )
527
553
new_cell .add_segment (
528
554
(0 , 0 , 0 , 20 ),
529
555
(20 , 0 , 0 , 20 ),
@@ -550,6 +576,8 @@ def test_simple_cell(self):
550
576
# test with component_factory
551
577
cell = component_factory ("Cell" , id = "simple_cell" )
552
578
cell .set_spike_thresh ("40mV" )
579
+ cell .set_init_memb_potential ("-70mV" )
580
+ cell .set_specific_capacitance ("1 uF_per_cm2" )
553
581
cell .notes = "NeuroML cell created by CellBuilder"
554
582
555
583
# Add soma segment
@@ -571,6 +599,8 @@ def test_complex_cell(self):
571
599
# with component_factory
572
600
cell = component_factory ("Cell" , id = "complex_cell" ) # type: neuroml.Cell
573
601
cell .set_spike_thresh ("40mV" )
602
+ cell .set_init_memb_potential ("-70mV" )
603
+ cell .set_specific_capacitance ("1 uF_per_cm2" )
574
604
cell .notes = "NeuroML cell created by CellBuilder"
575
605
576
606
# Add soma segment
@@ -600,6 +630,8 @@ def test_component_factory_create_cell(self):
600
630
"""Test cell creation"""
601
631
new_cell = component_factory ("Cell" , id = "test_cell" )
602
632
new_cell .set_spike_thresh ("40mV" )
633
+ new_cell .set_init_memb_potential ("-70mV" )
634
+ new_cell .set_specific_capacitance ("1 uF_per_cm2" )
603
635
self .assertIsInstance (new_cell , neuroml .Cell )
604
636
605
637
# cell does not have segments: is invalid NeuroML
@@ -611,6 +643,8 @@ def test_add_unbranched_segments(self):
611
643
# test with component_factory
612
644
cell = component_factory ("Cell" , id = "simple_cell" )
613
645
cell .set_spike_thresh ("40mV" )
646
+ cell .set_init_memb_potential ("-70mV" )
647
+ cell .set_specific_capacitance ("1 uF_per_cm2" )
614
648
cell .notes = "NeuroML cell created by CellBuilder"
615
649
616
650
# Add soma segment
@@ -647,6 +681,8 @@ def test_optimise_segment_group(self):
647
681
"""Test `optimise_segment_group`"""
648
682
cell = component_factory ("Cell" , id = "simple_cell" ) # type: neuroml.Cell
649
683
cell .set_spike_thresh ("40mV" )
684
+ cell .set_init_memb_potential ("-70mV" )
685
+ cell .set_specific_capacitance ("1 uF_per_cm2" )
650
686
cell .notes = "NeuroML cell created by CellBuilder"
651
687
652
688
# Add soma segment
@@ -688,6 +724,8 @@ def test_create_unbranched_segment_group_branches(self):
688
724
"Test create_unbranched_segment_group_branches"
689
725
cell = component_factory ("Cell" , id = "simple_cell" ) # type: neuroml.Cell
690
726
cell .set_spike_thresh ("40mV" )
727
+ cell .set_init_memb_potential ("-70mV" )
728
+ cell .set_specific_capacitance ("1 uF_per_cm2" )
691
729
cell .notes = "NeuroML cell created by CellBuilder"
692
730
693
731
# Add soma segment
@@ -758,6 +796,8 @@ def test_morphinfo(self):
758
796
# with component_factory
759
797
cell = component_factory ("Cell" , id = "complex_cell" ) # type: neuroml.Cell
760
798
cell .set_spike_thresh ("40mV" )
799
+ cell .set_init_memb_potential ("-70mV" )
800
+ cell .set_specific_capacitance ("1 uF_per_cm2" )
761
801
cell .notes = "NeuroML cell created by CellBuilder"
762
802
763
803
# Add soma segment
@@ -797,3 +837,8 @@ def test_class_hierarchy(self):
797
837
print (hier )
798
838
print ()
799
839
print_hierarchy (hier )
840
+
841
+ if __name__ == "__main__" :
842
+ ta = TestNML ()
843
+
844
+ ta .test_add_segment ()
0 commit comments