예제 #1
0
 def _do_show_data(self, names):
     # local import to allow this module to be imported without pyplot being imported
     import matplotlib.pyplot
     parent, flags = get_window_config()
     for ws in self._ads.retrieveWorkspaces(names, unrollGroups=True):
         try:
             MatrixWorkspaceDisplay.supports(ws)
             # the plot function is being injected in the presenter
             # this is done so that the plotting library is mockable in testing
             presenter = MatrixWorkspaceDisplay(ws,
                                                plot=plot,
                                                parent=parent,
                                                window_flags=flags)
             presenter.show_view()
         except ValueError:
             try:
                 TableWorkspaceDisplay.supports(ws)
                 presenter = TableWorkspaceDisplay(ws,
                                                   plot=matplotlib.pyplot,
                                                   parent=parent,
                                                   window_flags=flags,
                                                   batch=True)
                 presenter.show_view()
             except ValueError:
                 logger.error(
                     "Could not open workspace: {0} with neither "
                     "MatrixWorkspaceDisplay nor TableWorkspaceDisplay."
                     "".format(ws.name()))
예제 #2
0
 def _do_show_data(self, names):
     for ws in self._ads.retrieveWorkspaces(names, unrollGroups=True):
         try:
             MatrixWorkspaceDisplay.supports(ws)
             # the plot function is being injected in the presenter
             # this is done so that the plotting library is mockable in testing
             presenter = MatrixWorkspaceDisplay(ws, plot=plot, parent=self)
             presenter.show_view()
         except ValueError:
             try:
                 TableWorkspaceDisplay.supports(ws)
                 presenter = TableWorkspaceDisplay(ws, plot=matplotlib.pyplot, parent=self)
                 presenter.show_view()
             except ValueError:
                 logger.error(
                     "Could not open workspace: {0} with neither "
                     "MatrixWorkspaceDisplay nor TableWorkspaceDisplay."
                     "".format(ws.name()))
예제 #3
0
 def _do_show_data(self, names):
     for ws in self._ads.retrieveWorkspaces(names, unrollGroups=True):
         try:
             MatrixWorkspaceDisplay.supports(ws)
             # the plot function is being injected in the presenter
             # this is done so that the plotting library is mockable in testing
             presenter = MatrixWorkspaceDisplay(ws, plot=plot, parent=self)
             presenter.show_view()
         except ValueError:
             try:
                 TableWorkspaceDisplay.supports(ws)
                 presenter = TableWorkspaceDisplay(ws, plot=matplotlib.pyplot, parent=self)
                 presenter.show_view()
             except ValueError:
                 logger.error(
                     "Could not open workspace: {0} with neither "
                     "MatrixWorkspaceDisplay nor TableWorkspaceDisplay."
                     "".format(ws.name()))