sknrf.app.dataviewer.model.equation module

Equation (sknrf.model.dataviewer.equation)

This module stores custom post-measurement calculations inside a dataset.

See Also

sknrf.model.dataviewer.dataset.DatagroupModel, sknrf.model.dataviewer.dataset.DatasetModel

class sknrf.app.dataviewer.model.equation.DatasetEquationModel(dataset, name='Untitled')

Bases: object

Dataset Equation Model

A temporary dataset attribute defined by:
  • A string name

  • A string expression in terms of current dataset attributes that evaluates to a value using the built-in eval() function.

Parameters:
datasetDatasetModel

Reference to the current dataset.

namestr

Name of the dataset equation.

eval(dataset, eqn='')

Evaluate the Dataset Equation expression based on attributes in the current dataset

Parameters:
datasetstr

Reference to the current dataset.

eqnstr

A string expression in terms of current dataset attributes that evaluates to a value using the built-in eval() function.

class sknrf.app.dataviewer.model.equation.EquationTableModel(root, parent=None)

Bases: QAbstractTableModel

flags(self, index: Union[PySide6.QtCore.QModelIndex, PySide6.QtCore.QPersistentModelIndex]) PySide6.QtCore.Qt.ItemFlag
headerData(self, section: int, orientation: PySide6.QtCore.Qt.Orientation, role: int = Instance(Qt.DisplayRole)) Any
rowCount(self, parent: Union[PySide6.QtCore.QModelIndex, PySide6.QtCore.QPersistentModelIndex] = Invalid(PySide6.QtCore.QModelIndex)) int
columnCount(self, parent: Union[PySide6.QtCore.QModelIndex, PySide6.QtCore.QPersistentModelIndex] = Invalid(PySide6.QtCore.QModelIndex)) int
selected()
Returns:
ndarray

The selected dictionary value based on the selected row.

set_selected(index)

Set the selected dictionary value

Parameters:
indexQtCore.QModelIndex

The table row to be selected.

data(index, role=ItemDataRole.DisplayRole)

Get the table data.

Parameters:
indexQtCore.QModelIndex

The table index to get.

roleQt.DisplayRole, optional

The requested data role to get.

Returns:
QtCore.QVariant

The return type is determined by the data role.

staticMetaObject = PySide6.QtCore.QMetaObject("EquationTableModel" inherits "QAbstractTableModel": Methods:   #77 type=Slot, signature=set_selected(int), parameters=int )