Trouble with sim.loadSimData()

A Python package that facilitates development and use of models of biological neural networks

Moderator: tom_morse

Post Reply
Posts: 7
Joined: Fri Jun 16, 2017 3:10 pm

Trouble with sim.loadSimData()

Post by astaylor »

Hi guys,

I've been having trouble using loadSimData(filename) with a mat lab file. For example, sim.loadSimData("model_output.mat") is what I have exactly in my code now.

The error I'm getting in terminal reads:

Code: Select all

  File "", line 363, in <module>
  File "/Users/aliyahtaylor/anaconda/lib/python2.7/site-packages/netpyne/", line 226, in loadSimData
    if not data: data = _loadFile(filename)
  File "/Users/aliyahtaylor/anaconda/lib/python2.7/site-packages/netpyne/", line 326, in _loadFile
    return simData
NameError: global name 'simData' is not defined
I checked the file and the only code there for a mat extension is:

elif ext == 'mat':
from import savemat
print('Loading file %s ... ' % (filename))
#savemat(sim.cfg.filename+'.mat', replaceNoneObj(dataSave)) # replace None and {} with [] so can save in .mat format
print('Finished saving!')

so I was wondering if this has been implemented yet.


Posts: 85
Joined: Tue Aug 18, 2015 3:49 pm

Re: Trouble with sim.loadSimData()

Post by salvadord »

Hi, indeed loading from .mat wasn't yet implemented -- only load from .pkl and .json was available. However, I have just added this feature and pushed to the github development branch. If you want to resimulate or reanalyze results etc. you will also need the net, so probably best to use sim.loadAll("model_output.mat") or sim.load("model_output.mat").

Let me know if you have any other issues.

Post Reply