lysTable
- class lys.widgets.table.lysTable.lysTable(parent=None)[source]
Bases:
QWidget
lysTable is a widget that shows data and axes of
lys.core.Wave
.The functionarity of data handling is implemented in
lys.widgets.table.Data.TableData
class.All public methods in
lys.widgets.table.Data.TableData
class can be accessed from lysTable.To generate lysTable, it is recommended to use
lys.functions.edit()
function.Example:
import numpy as np from lys import edit, Wave w = Wave(np.random.rand(100, 100)) edit(w)
- finalized
Emitted when the table is finalized.
- keyPressed
Emitted when keyPressEvent is raised.
- loadFromDictionary(d)[source]
Load the contents of the table from dictionary.
- Parameters
d (dict) – The dictionary.
- loadTable
Emitted when the table is loaded by loadFromDictionary method.
- saveAsDictionary()[source]
Save the contetnts of the table as dictionary.
- Returns
The dictionary.
- Return type
dict
- saveTable
Emitted when the table is saved by saveAsDictionary method.
- class lys.widgets.table.Data.TableData(table)[source]
Bases:
QObject
TableData class handles data in
lys.widgets.table.lysTable.lysTable
.- Parameters
table (lysTable) – The table widget.
- dataChanged
Emitted when the data is changed.
- dataSaved
Emitted after the data is saved.
- getSlice()[source]
Get slice. See
setSlice()
- Returns
The slice.
- Return type
tuple of slices or int
- save()[source]
Save the contents of the table to file or Wave depending on the argument of
setData()
.
- setData(data)[source]
Set data.
- Parameters
data (str or Wave) – The path to a npz file, or an instance of Wave.
- setSlice(slc=None)[source]
Set a slice.
If slc is None, the default slice is set.
If slc is integer,
getSlicedData()
returns wave.axes[slc].Otherwise,
getSlicedData()
returns wave.data[slc].- Parameters
slc (tuple of slices or int) – The slice to be set.
- updated
Emitted when data data is updated.