Trouble with sim.loadSimData()

Moderator: tom_morse

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

Trouble with sim.loadSimData()

Post by astaylor » Fri Jul 21, 2017 3:16 pm

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

elif ext == 'mat':
from scipy.io 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.

Thanks!

salvadord
Posts: 57
Joined: Tue Aug 18, 2015 3:49 pm

Re: Trouble with sim.loadSimData()

Post by salvadord » Mon Jul 24, 2017 6:07 pm

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