How to use the plottr.node.grid.GridOption function in plottr

To help you get started, we’ve selected a few plottr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github data-plottr / plottr / test / pytest / test_gridder.py View on Github external
)
    assert data.validate()

    fc.setInput(dataIn=data)
    assert num.arrays_equal(
        fc.outputValues()['dataOut'].data_vals('vals'),
        v1d,
    )

    node.grid = GridOption.guessShape, dict()
    assert num.arrays_equal(
        fc.outputValues()['dataOut'].data_vals('vals'),
        vv,
    )

    node.grid = GridOption.specifyShape, dict(shape=(5, 5, 2))
    assert num.arrays_equal(
        fc.outputValues()['dataOut'].data_vals('vals'),
        vv,
    )
github data-plottr / plottr / test / pytest / test_gridder.py View on Github external
v1d = vv.flatten()
    data = DataDict(
        x=dict(values=x1d),
        y=dict(values=y1d),
        z=dict(values=z1d),
        vals=dict(values=v1d, axes=['x', 'y', 'z'])
    )
    assert data.validate()

    fc.setInput(dataIn=data)
    assert num.arrays_equal(
        fc.outputValues()['dataOut'].data_vals('vals'),
        v1d,
    )

    node.grid = GridOption.guessShape, dict()
    assert num.arrays_equal(
        fc.outputValues()['dataOut'].data_vals('vals'),
        vv,
    )

    node.grid = GridOption.specifyShape, dict(shape=(5, 5, 2))
    assert num.arrays_equal(
        fc.outputValues()['dataOut'].data_vals('vals'),
        vv,
    )
github data-plottr / plottr / plottr / node / grid.py View on Github external
def gridButtonSelected(self, btn, checked):
        if checked:

            # only emit the signal when the update is from the UI
            if self._emitUpdate:
                self.signalGridOption(self.getGrid())

            if GridOption(self.btnGroup.id(btn)) == GridOption.specifyShape:
                self.enableShapeEdit(True)
            else:
                self.enableShapeEdit(False)

            self._emitUpdate = True
github data-plottr / plottr / plottr / node / grid.py View on Github external
def __init__(self, parent=None):
        super().__init__(parent)

        self._emitUpdate = True

        #  make radio buttons and layout ##
        self.buttons = {
            GridOption.noGrid: QtGui.QRadioButton('No grid'),
            GridOption.guessShape: QtGui.QRadioButton('Guess shape'),
            GridOption.specifyShape: QtGui.QRadioButton('Specify shape'),
        }

        btnLayout = QtGui.QVBoxLayout()
        self.btnGroup = QtGui.QButtonGroup(self)

        for opt in GridOption:
            btn = self.buttons[opt]
            self.btnGroup.addButton(btn, opt.value)
            btnLayout.addWidget(btn)

        btnBox = QtGui.QGroupBox('Grid')
        btnBox.setLayout(btnLayout)

        # make shape spec widget
        self.shapeSpec = ShapeSpecificationWidget()
github data-plottr / plottr / plottr / node / grid.py View on Github external
def getGrid(self):
        activeBtn = self.btnGroup.checkedButton()
        activeId = self.btnGroup.id(activeBtn)
        opts = {}

        if GridOption(activeId) == GridOption.specifyShape:
            opts['shape'] = self.shapeSpec.getShape()

        return GridOption(activeId), opts
github data-plottr / plottr / plottr / apps / autoplot.py View on Github external
"""
        try to set some reasonable defaults so there's a plot right away.
        """
        selected = data.dependents()
        if len(selected) > 0:
            selected = selected[:1]

        axes = data.axes(selected)
        drs = dict()
        if len(axes) >= 2:
            drs = {axes[-1]: 'x-axis', axes[-2]: 'y-axis'}
        if len(axes) == 1:
            drs = {axes[0]: 'x-axis'}

        self.fc.nodes()['Data selection'].selectedData = selected
        self.fc.nodes()['Grid'].grid = GridOption.guessShape, {}
        self.fc.nodes()['Dimension assignment'].dimensionRoles = drs
        self.plotWidget.plot.draw()
github data-plottr / plottr / plottr / node / grid.py View on Github external
def __init__(self, parent=None):
        super().__init__(parent)

        self._emitUpdate = True

        #  make radio buttons and layout ##
        self.buttons = {
            GridOption.noGrid: QtGui.QRadioButton('No grid'),
            GridOption.guessShape: QtGui.QRadioButton('Guess shape'),
            GridOption.specifyShape: QtGui.QRadioButton('Specify shape'),
        }

        btnLayout = QtGui.QVBoxLayout()
        self.btnGroup = QtGui.QButtonGroup(self)

        for opt in GridOption:
            btn = self.buttons[opt]
            self.btnGroup.addButton(btn, opt.value)
            btnLayout.addWidget(btn)

        btnBox = QtGui.QGroupBox('Grid')
        btnBox.setLayout(btnLayout)

        # make shape spec widget
github data-plottr / plottr / plottr / node / grid.py View on Github external
def __init__(self, parent=None):
        super().__init__(parent)

        self._emitUpdate = True

        #  make radio buttons and layout ##
        self.buttons = {
            GridOption.noGrid: QtGui.QRadioButton('No grid'),
            GridOption.guessShape: QtGui.QRadioButton('Guess shape'),
            GridOption.specifyShape: QtGui.QRadioButton('Specify shape'),
        }

        btnLayout = QtGui.QVBoxLayout()
        self.btnGroup = QtGui.QButtonGroup(self)

        for opt in GridOption:
            btn = self.buttons[opt]
            self.btnGroup.addButton(btn, opt.value)
            btnLayout.addWidget(btn)

        btnBox = QtGui.QGroupBox('Grid')
        btnBox.setLayout(btnLayout)

        # make shape spec widget
        self.shapeSpec = ShapeSpecificationWidget()
        shapeLayout = QtGui.QVBoxLayout()
        shapeLayout.addWidget(self.shapeSpec)
        shapeBox = QtGui.QGroupBox('Shape')
        shapeBox.setLayout(shapeLayout)

        # Widget layout
        layout = QtGui.QHBoxLayout()