Page 1 of 1

Trouble with sim.loadSimData()

Posted: Fri Jul 21, 2017 3:16 pm
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 "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!

Re: Trouble with sim.loadSimData()

Posted: Mon Jul 24, 2017 6:07 pm
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.