Skip to content

Commit

Permalink
added converting vecstims to list in distributed simdata saving
Browse files Browse the repository at this point in the history
  • Loading branch information
salvadord committed Mar 26, 2020
1 parent 8a6976e commit dfad4dc
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
23 changes: 22 additions & 1 deletion netpyne/sim/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,28 @@ def saveSimDataInNode(filename=None):
dataSave['netpyne_version'] = sim.version(show=False)
dataSave['netpyne_changeset'] = sim.gitChangeset(show=False)

dataSave['simData'] = sim.simData
simDataVecs = ['spkt','spkid','stims']+list(sim.cfg.recordTraces.keys())
singleNodeVecs = ['t']

saveSimData = {}
for k in list(sim.simData.keys()): # initialize all keys of allSimData dict
saveSimData[k] = {}
for key,val in sim.simData.items(): # update simData dics of dics of h.Vector
if key in simDataVecs+singleNodeVecs: # simData dicts that contain Vectors
if isinstance(val,dict):
for cell,val2 in val.items():
if isinstance(val2,dict):
saveSimData[key].update({cell: {}})
for stim,val3 in val2.items():
saveSimData[key][cell].update({stim:list(val3)}) # udpate simData dicts which are dicts of dicts of Vectors (eg. ['stim']['cell_1']['backgrounsd']=h.Vector)
else:
saveSimData[key].update({cell:list(val2)}) # udpate simData dicts which are dicts of Vectors (eg. ['v']['cell_1']=h.Vector)
else:
saveSimData[key] = list(saveSimData[key])+list(val) # udpate simData dicts which are Vectors
else:
saveSimData[key] = val # update simData dicts which are not Vectors

dataSave['simData'] = saveSimData

if getattr(sim.net.params, 'version', None): dataSave['netParams_version'] = sim.net.params.version

Expand Down
13 changes: 7 additions & 6 deletions sdnotes.org
Original file line number Diff line number Diff line change
Expand Up @@ -7665,13 +7665,14 @@ def genLFP (lrec,lx,ly,lz,elx,ely,elz):
- create PR from development to master (via https://github.com/Neurosim-lab/netpyne)
- make sure no conflicts and Travis tests pass
- merge PR
- bnp (to build documentation)
- npr (to release on pip)
- "bnp" alias (to build documentation)
- "npr" alias(to release on pip)
- Announce new release:
-- in github: https://github.com/Neurosim-lab/netpyne/releases
-- in NEURON forum: https://www.neuron.yale.edu/phpBB/viewtopic.php?f=45&t=3685&sid=9c380fe3a835babd47148c81ae71343e
-- in Google group: https://groups.google.com/forum/#!forum/netpyne-mailing
-- in Slack
-- on github: https://github.com/Neurosim-lab/netpyne/releases
-- on NEURON forum: https://www.neuron.yale.edu/phpBB/viewtopic.php?f=45&t=3685&sid=9c380fe3a835babd47148c81ae71343e
-- on Google group: https://groups.google.com/forum/#!forum/netpyne-mailing
-- on Slack #netpyne
-- on Twitter (salvador account; create netpyne account?)

* Netpyne Models/Users
** Github examples folder
Expand Down

0 comments on commit dfad4dc

Please sign in to comment.