Skip to content

Commit da870fd

Browse files
committed
Clearer printouts - test active
1 parent c5761be commit da870fd

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

CellTypesDatabase/models/ParseAll.py

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
ca_dynamics = {}
4747

48-
print("Parsing cell dirs: %s" % cell_dirs)
48+
print("PA >> Parsing cell dirs: %s" % cell_dirs)
4949

5050
for model_id in cell_dirs:
5151

@@ -65,7 +65,7 @@
6565

6666
# configure NEURON
6767
if all_active:
68-
continue # skip this...
68+
#continue # skip this...
6969
utils = AllActiveUtils(description, axon_type='stub') # all-active type
7070
else:
7171
#continue
@@ -74,7 +74,7 @@
7474

7575
h = utils.h
7676

77-
print("NEURON configured")
77+
print("PA >> NEURON configured")
7878

7979
# configure model
8080
manifest = description.manifest
@@ -87,9 +87,9 @@
8787
with open('metadata.json', "r") as json_file:
8888
metadata_info = json.load(json_file)
8989

90-
print("Loaded manifest: %s (fit: %s)"%(manifest_info['biophys'][0]["model_type"], manifest_info['biophys'][0]["model_file"][1]))
90+
print("PA >> Loaded manifest: %s (fit: %s)"%(manifest_info['biophys'][0]["model_type"], manifest_info['biophys'][0]["model_file"][1]))
9191

92-
print("Cell loaded from: %s"%morphology_path)
92+
print("PA >> Cell loaded from: %s"%morphology_path)
9393

9494
h.finitialize()
9595
h.psection()
@@ -102,14 +102,15 @@
102102
nml_cell_loc = "%s/%s"%(nml2_cell_dir,nml_cell_file)
103103

104104

105-
print(' > Exporting to %s'%(nml_net_loc))
105+
print('PA >> Exporting to %s'%(nml_net_loc))
106106

107107
export_to_neuroml2(None,
108108
nml_net_loc,
109109
separateCellFiles=True,
110-
includeBiophysicalProperties=False)
110+
includeBiophysicalProperties=False,
111+
validate=False)
111112

112-
print(' > Exported to: %s and %s'%(nml_net_loc, nml_cell_loc))
113+
print('PA >> Exported to: %s and %s'%(nml_net_loc, nml_cell_loc))
113114

114115

115116
clear_neuron()
@@ -133,10 +134,10 @@
133134
p = neuroml.Property(tag=k, value=metadata_info[k])
134135
cell.properties.append(p)
135136

136-
print(' > Altering groups')
137+
print('PA >> Altering groups')
137138

138139
for sg in cell.morphology.segment_groups:
139-
print("Found group: %s"%sg.id)
140+
print("PA >> Found group: %s"%sg.id)
140141
if (sg.id.startswith('ModelViewParm')) and len(sg.members)==0:
141142
replace = {}
142143
replace['soma_'] = 'soma'
@@ -282,7 +283,7 @@
282283
283284
'''
284285
# @type ca_dynamics dict
285-
print('Handling Ca dynamics: %s'%ca_dynamics)
286+
print('PA >> Handling Ca dynamics: %s'%ca_dynamics)
286287
for key, values in ca_dynamics.items():
287288
if int(key) in ALL_ACTIVE_MODEL_IDS:
288289
for segment, prop in values.items():
@@ -309,10 +310,11 @@
309310
cell.biophysical_properties = biophysical_properties
310311

311312

312-
pynml.write_neuroml2_file(nml_doc, nml_cell_loc)
313+
print('PA >> Writing to: %s'%nml_cell_loc)
314+
pynml.write_neuroml2_file(nml_doc, nml_cell_loc, validate=False)
313315

314316

315-
pynml.nml2_to_svg(nml_cell_loc)
317+
pynml.nml2_to_svg(nml_cell_loc, verbose=False)
316318

317319

318320
pref_duration_ms = 2500
@@ -359,7 +361,9 @@
359361
input_list.input.append(input)
360362
new_net.input_lists.append(input_list)
361363

362-
pynml.write_neuroml2_file(new_net_doc, new_net_loc)
364+
print('PA >> Writing to: %s'%new_net_loc)
365+
366+
pynml.write_neuroml2_file(new_net_doc, new_net_loc, validate=False)
363367

364368
generate_lems_file_for_neuroml(model_id,
365369
new_net_loc,
@@ -386,12 +390,14 @@
386390
Z = ((count-1) -X) / width
387391
inst.location = neuroml.Location(x=300*X, y=0, z=300*Z)
388392

393+
print('PA >> Adding to network of all cells at: %s'%inst.location)
394+
389395

390396
net_file = '%s/%s.net.nml'%(nml2_cell_dir,net_ref)
391397
neuroml.writers.NeuroMLWriter.write(net_doc, net_file)
392398

393-
print("Written network with %i cells in network to: %s"%(count,net_file))
399+
print("PA >> Written network with %i cells in network to: %s"%(count,net_file))
394400

395-
pynml.nml2_to_svg(net_file)
401+
pynml.nml2_to_svg(net_file, verbose=False)
396402

397-
print("Finished parsing cell dirs: %s" % cell_dirs)
403+
print("PA >> Finished parsing cell dirs: %s" % cell_dirs)

0 commit comments

Comments
 (0)