Load data¶
- class encore.data.load_data.FileTreeItem(name: str, obj, mdl_type: str, MATLAB_available=False, parent=None)¶
Class to define a item for a FileTreeModel object.
- child(row)¶
- child_count()¶
- column_count()¶
- data()¶
- item_path()¶
Returns the path of the variable in the file. Nested structures are separated using the character “/”
- Returns:
The path to the current variable
- Return type:
string
- item_size()¶
Returns the shape of the current variable. If the variable is not a matrix then the value -1 is returned.
- Returns:
Shape of the variable
- Return type:
tuple
- item_type()¶
- parent()¶
- row()¶
- class encore.data.load_data.FileTreeModel(hdf5_file, model_type, parent=None, MATLAB_available=False)¶
Generates an abstract item model to be used in a PyQt6 tree widget. This produces a model with the structure of the variables in a file.
- Parameters:
QAbstractItemModel (QAbstractItemModel) – QAbstractItemModel from PyQt6
- columnCount(self, parent: QModelIndex = QModelIndex()) int¶
- data(self, index: QModelIndex, role: int = Qt.DisplayRole) Any¶
- data_name(index, role=ItemDataRole.DisplayRole)¶
- data_size(index, role=ItemDataRole.DisplayRole)¶
- data_type(index, role=ItemDataRole.DisplayRole)¶
- flags(self, index: QModelIndex) Qt.ItemFlag¶
- headerData(self, section: int, orientation: Qt.Orientation, role: int = Qt.DisplayRole) Any¶
- index(self, row: int, column: int, parent: QModelIndex = QModelIndex()) QModelIndex¶
- parent(self, child: QModelIndex) QModelIndex¶
- parent(self) QObject | None
- rowCount(self, parent: QModelIndex = QModelIndex()) int¶