Skip to content

Commit d409801

Browse files
author
rodriguez-facundo
committed
click on raster return error is network in not simulated yet
1 parent 6f4712b commit d409801

1 file changed

Lines changed: 25 additions & 19 deletions

File tree

netpyne_ui/netpyne_geppetto.py

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -372,25 +372,31 @@ def getDirList(self, dir=None, onlyDirs = False, filterFiles=False):
372372
return dir_list
373373

374374
def getPlot(self, plotName, LFPflavour):
375-
args = self.getPlotSettings(plotName)
376-
if LFPflavour:
377-
args['plots'] = [LFPflavour]
378-
fig = getattr(analysis, plotName)(showFig=False, **args)[0]
379-
if fig==-1:
380-
return fig
381-
elif isinstance(fig, list):
382-
# return [ui.getSVG(fig[0])].__str__()
383-
return [ui.getSVG(fig[0])]
384-
elif isinstance(fig, dict):
385-
svgs = []
386-
for key, value in fig.items():
387-
logging.debug("Found plot for "+ key)
388-
svgs.append(ui.getSVG(value))
389-
#return svgs.__str__()
390-
return svgs
391-
else:
392-
#return [ui.getSVG(fig)].__str__()
393-
return [ui.getSVG(fig)]
375+
with redirect_stdout(sys.__stdout__):
376+
args = self.getPlotSettings(plotName)
377+
if LFPflavour:
378+
args['plots'] = [LFPflavour]
379+
figData = getattr(analysis, plotName)(showFig=False, **args)
380+
381+
if isinstance(figData, tuple):
382+
fig = figData[0]
383+
if fig==-1:
384+
return fig
385+
elif isinstance(fig, list):
386+
# return [ui.getSVG(fig[0])].__str__()
387+
return [ui.getSVG(fig[0])]
388+
elif isinstance(fig, dict):
389+
svgs = []
390+
for key, value in fig.items():
391+
logging.debug("Found plot for "+ key)
392+
svgs.append(ui.getSVG(value))
393+
#return svgs.__str__()
394+
return svgs
395+
else:
396+
#return [ui.getSVG(fig)].__str__()
397+
return [ui.getSVG(fig)]
398+
else:
399+
return figData
394400

395401
def getAvailablePops(self):
396402
return list(self.netParams.popParams.keys())

0 commit comments

Comments
 (0)