def main(filenames): from peacock.PostprocessorViewer.PostprocessorViewer import PostprocessorViewer from FigurePlugin import FigurePlugin from PostprocessorSelectPlugin import PostprocessorSelectPlugin widget = PostprocessorViewer(mooseutils.VectorPostprocessorReader, plugins=[FigurePlugin, PostprocessorSelectPlugin, MediaControlPlugin]) widget.onSetFilenames(filenames) widget.show() return widget
def main(filenames): from peacock.PostprocessorViewer.PostprocessorViewer import PostprocessorViewer from FigurePlugin import FigurePlugin from PostprocessorSelectPlugin import PostprocessorSelectPlugin widget = PostprocessorViewer(mooseutils.VectorPostprocessorReader, plugins=[FigurePlugin, PostprocessorSelectPlugin, MediaControlPlugin]) widget.onSetFilenames(filenames) widget.show() return widget
def main(): """ Run FigurePlugin by itself. """ from peacock.PostprocessorViewer.PostprocessorViewer import PostprocessorViewer import mooseutils widget = PostprocessorViewer(mooseutils.VectorPostprocessorReader, plugins=[FigurePlugin]) widget.initialize([]) widget.currentWidget().FigurePlugin.setFixedSize(QtCore.QSize(375, 375)) widget.show() return widget
def main(filenames): from peacock.PostprocessorViewer.PostprocessorViewer import PostprocessorViewer from PostprocessorSelectPlugin import PostprocessorSelectPlugin from MediaControlPlugin import MediaControlPlugin widget = PostprocessorViewer(mooseutils.VectorPostprocessorReader, timeout=None, plugins=[OutputPlugin, PostprocessorSelectPlugin, MediaControlPlugin]) widget.onSetFilenames(filenames) control = widget.currentWidget().OutputPlugin widget.show() return control, widget
def main(): """ Run FigurePlugin by itself. """ from peacock.PostprocessorViewer.PostprocessorViewer import PostprocessorViewer import mooseutils widget = PostprocessorViewer(mooseutils.VectorPostprocessorReader, plugins=[FigurePlugin]) widget.onSetFilenames([]) widget.currentWidget().FigurePlugin.setFixedSize(QtCore.QSize(375, 375)) widget.show() return widget
def main(filenames): from peacock.PostprocessorViewer.PostprocessorViewer import PostprocessorViewer from PostprocessorSelectPlugin import PostprocessorSelectPlugin from MediaControlPlugin import MediaControlPlugin widget = PostprocessorViewer( mooseutils.VectorPostprocessorReader, timeout=None, plugins=[OutputPlugin, PostprocessorSelectPlugin, MediaControlPlugin]) widget.initialize(filenames) control = widget.currentWidget().OutputPlugin widget.show() return control, widget
def main(filenames): from peacock.PostprocessorViewer.PostprocessorViewer import PostprocessorViewer from FigurePlugin import FigurePlugin from PostprocessorSelectPlugin import PostprocessorSelectPlugin import mooseutils widget = PostprocessorViewer(mooseutils.PostprocessorReader, timeout=None, plugins=[FigurePlugin, AxisTabsPlugin, PostprocessorSelectPlugin]) widget.onSetFilenames(filenames) control = widget.currentWidget().AxisTabsPlugin window = widget.currentWidget().FigurePlugin window.setFixedSize(QtCore.QSize(625, 625)) widget.show() return control, widget, window
def main(filenames, reader=mooseutils.VectorPostprocessorReader): """ Create widgets for running PostprocessorSelectPlugin """ """ Run FigurePlugin by itself. """ from peacock.PostprocessorViewer.PostprocessorViewer import PostprocessorViewer from FigurePlugin import FigurePlugin widget = PostprocessorViewer(reader, timeout=None, plugins=[FigurePlugin, PostprocessorSelectPlugin]) widget.onSetFilenames(filenames) control = widget.currentWidget().PostprocessorSelectPlugin window = widget.currentWidget().FigurePlugin window.setFixedSize(QtCore.QSize(625, 625)) widget.show() return control, widget, window
def main(filenames, reader=mooseutils.VectorPostprocessorReader): """ Create widgets for running PostprocessorSelectPlugin """ """ Run FigurePlugin by itself. """ from peacock.PostprocessorViewer.PostprocessorViewer import PostprocessorViewer from FigurePlugin import FigurePlugin widget = PostprocessorViewer(reader, timeout=None, plugins=[FigurePlugin, PostprocessorSelectPlugin]) widget.onSetFilenames(filenames) control = widget.currentWidget().PostprocessorSelectPlugin window = widget.currentWidget().FigurePlugin window.setFixedSize(QtCore.QSize(625, 625)) widget.show() return control, widget, window
def main(*args): """ Create a LineSettingsWidget for testing. """ from peacock.PostprocessorViewer.PostprocessorViewer import PostprocessorViewer from FigurePlugin import FigurePlugin # Load the viewer widget = PostprocessorViewer(plugins=[FigurePlugin]) widget.onSetFilenames(['empty_file']) layout = widget.currentWidget().LeftLayout window = widget.currentWidget().FigurePlugin window.setFixedSize(QtCore.QSize(375, 375)) # Test the line setting widget toggle = LineSettingsWidget(*args) layout.addWidget(toggle) widget.show() return widget, toggle, window
def main(data, pp_class=mooseutils.VectorPostprocessorReader): """ Create widgets for running LineGroupWidget """ from peacock.PostprocessorViewer.PostprocessorViewer import PostprocessorViewer from FigurePlugin import FigurePlugin import matplotlib.pyplot as plt import numpy as np import itertools # Create main widget widget = PostprocessorViewer(plugins=[FigurePlugin]) widget.onSetFilenames(['empty_file']) layout = widget.currentWidget().LeftLayout window = widget.currentWidget().FigurePlugin window.setFixedSize(QtCore.QSize(625, 625)) # Create LineGroupWidget cycle = itertools.product(['-', '--', '-.', ':'], plt.cm.Paired(np.linspace(0, 1, 11))) control = LineGroupWidget(window.axes(), data, cycle) layout.addWidget(control) control.axesModified.connect(window.onAxesModified) def axis_label(): """ A labeling function for setting axis labels. """ x, y, y2 = control.getAxisLabels() control._axes[0].set_xlabel(x) control._axes[0].set_ylabel('; '.join(y)) control._axes[1].set_ylabel('; '.join(y2)) control.variablesChanged.connect(axis_label) widget.show() return control, widget, window
def main(data, pp_class=mooseutils.VectorPostprocessorReader): """ Create widgets for running LineGroupWidget """ from peacock.PostprocessorViewer.PostprocessorViewer import PostprocessorViewer from FigurePlugin import FigurePlugin import matplotlib.pyplot as plt import numpy as np import itertools # Create main widget widget = PostprocessorViewer(plugins=[FigurePlugin]) widget.onSetFilenames(['empty_file']) layout = widget.currentWidget().LeftLayout window = widget.currentWidget().FigurePlugin window.setFixedSize(QtCore.QSize(625, 625)) # Create LineGroupWidget cycle = itertools.product(['-', '--', '-.', ':'], plt.cm.Paired(np.linspace(0, 1, 11))) control = LineGroupWidget(window.axes(), data, cycle) layout.addWidget(control) control.axesModified.connect(window.onAxesModified) def axis_label(): """ A labeling function for setting axis labels. """ x,y,y2 = control.getAxisLabels() control._axes[0].set_xlabel(x) control._axes[0].set_ylabel('; '.join(y)) control._axes[1].set_ylabel('; '.join(y2)) control.variablesChanged.connect(axis_label) widget.show() return control, widget, window