def __init__(self, parent, data): QAbstractTableModel.__init__(self, parent) if data is None: data = {} self._data = None self.breakpoints = None self.set_data(data)
def __init__(self, data, format="%.3f", xlabels=None, ylabels=None, readonly=False, parent=None): QAbstractTableModel.__init__(self) self.dialog = parent self.changes = {} self.xlabels = xlabels self.ylabels = ylabels self.readonly = readonly self.test_array = np.array([0], dtype=data.dtype) # for complex numbers, shading will be based on absolute value # but for all other types it will be the real part if data.dtype in (np.complex64, np.complex128): self.color_func = np.abs else: self.color_func = np.real # Backgroundcolor settings huerange = [.66, .99] # Hue self.sat = .7 # Saturation self.val = 1. # Value self.alp = .6 # Alpha-channel self._data = data self._format = format self.total_rows = self._data.shape[0] self.total_cols = self._data.shape[1] size = self.total_rows * self.total_cols try: self.vmin = np.nanmin(self.color_func(data)) self.vmax = np.nanmax(self.color_func(data)) if self.vmax == self.vmin: self.vmin -= 1 self.hue0 = huerange[0] self.dhue = huerange[1]-huerange[0] self.bgcolor_enabled = True except TypeError: self.vmin = None self.vmax = None self.hue0 = None self.dhue = None self.bgcolor_enabled = False # Use paging when the total size, number of rows or number of # columns is too large if size > LARGE_SIZE: self.rows_loaded = self.ROWS_TO_LOAD self.cols_loaded = self.COLS_TO_LOAD else: if self.total_rows > LARGE_NROWS: self.rows_loaded = self.ROWS_TO_LOAD else: self.rows_loaded = self.total_rows if self.total_cols > LARGE_COLS: self.cols_loaded = self.COLS_TO_LOAD else: self.cols_loaded = self.total_cols
def flags(self, index): if not index.isValid(): return Qt.ItemIsEnabled column = index.column() if column in (MOD1, MOD2, MOD3, KEY): return Qt.ItemFlags(QAbstractTableModel.flags(self, index) | Qt.ItemIsEditable) else: return Qt.ItemFlags(QAbstractTableModel.flags(self, index))
def flags(self, index): if not index.isValid(): return Qt.ItemIsEnabled column = index.column() if column in (MOD1, MOD2, MOD3, KEY): return Qt.ItemFlags( QAbstractTableModel.flags(self, index) | Qt.ItemIsEditable) else: return Qt.ItemFlags(QAbstractTableModel.flags(self, index))
def __init__(self, parent): QAbstractTableModel.__init__(self) self.shortcuts = [] self._parent = parent self.letters = '' self.label = QLabel() self.widths = [] # Needed to compensate for the HTMLDelegate color selection unawarness palette = parent.palette() self.text_color = palette.text().color().name() self.text_color_highlight = palette.highlightedText().color().name()
def __init__(self, parent): QAbstractTableModel.__init__(self) self._parent = parent self.shortcuts = [] self.scores = [] self.rich_text = [] self.letters = '' self.label = QLabel() self.widths = [] # Needed to compensate for the HTMLDelegate color selection unawarness palette = parent.palette() self.text_color = palette.text().color().name() self.text_color_highlight = palette.highlightedText().color().name()
def __init__(self, data, format="%.3f", xlabels=None, ylabels=None, readonly=False, parent=None): QAbstractTableModel.__init__(self) self.dialog = parent self.changes = {} self.xlabels = xlabels self.ylabels = ylabels self.readonly = readonly self.test_array = np.array([0], dtype=data.dtype) # for complex numbers, shading will be based on absolute value # but for all other types it will be the real part if data.dtype in (np.complex64, np.complex128): self.color_func = np.abs else: self.color_func = np.real # Backgroundcolor settings huerange = [.66, .99] # Hue self.sat = .7 # Saturation self.val = 1. # Value self.alp = .6 # Alpha-channel self._data = data self._format = format try: self.vmin = self.color_func(data).min() self.vmax = self.color_func(data).max() if self.vmax == self.vmin: self.vmin -= 1 self.hue0 = huerange[0] self.dhue = huerange[1] - huerange[0] self.bgcolor_enabled = True except TypeError: self.vmin = None self.vmax = None self.hue0 = None self.dhue = None self.bgcolor_enabled = False
def __init__(self, dataFrame, format="%.3g", parent=None): QAbstractTableModel.__init__(self) self.dialog = parent self.df = dataFrame self._format = format self.bgcolor_enabled = True self.complex_intran = None huerange = [.66, .99] # Hue self.sat = .7 # Saturation self.val = 1. # Value self.alp = .6 # Alpha-channel self.hue0 = huerange[0] self.dhue = huerange[1] - huerange[0] self.max_min_col = None self.max_min_col_update() self.colum_avg_enabled = True self.colum_avg(1)
def __init__(self, dataFrame, format="%.3g", parent=None): QAbstractTableModel.__init__(self) self.dialog = parent self.df = dataFrame self._format = format self.bgcolor_enabled = True self.complex_intran = None huerange = [.66, .99] # Hue self.sat = .7 # Saturation self.val = 1. # Value self.alp = .6 # Alpha-channel self.hue0 = huerange[0] self.dhue = huerange[1]-huerange[0] self.max_min_col = None self.max_min_col_update() self.colum_avg_enabled = True self.colum_avg(1)
def __init__(self, dataFrame, format="%.3g", parent=None): QAbstractTableModel.__init__(self) self.dialog = parent self.df = dataFrame self.df_index = dataFrame.index.tolist() self.df_header = dataFrame.columns.tolist() self._format = format self.complex_intran = None self.total_rows = self.df.shape[0] self.total_cols = self.df.shape[1] size = self.total_rows * self.total_cols huerange = [.66, .99] # Hue self.sat = .7 # Saturation self.val = 1. # Value self.alp = .6 # Alpha-channel self.hue0 = huerange[0] self.dhue = huerange[1] - huerange[0] self.max_min_col = None if size < LARGE_SIZE: self.max_min_col_update() self.colum_avg_enabled = True self.bgcolor_enabled = True self.colum_avg(1) else: self.colum_avg_enabled = False self.bgcolor_enabled = False self.colum_avg(0) # Use paging when the total size, number of rows or number of # columns is too large if size > LARGE_SIZE: self.rows_loaded = self.ROWS_TO_LOAD self.cols_loaded = self.COLS_TO_LOAD else: if self.total_rows > LARGE_NROWS: self.rows_loaded = self.ROWS_TO_LOAD else: self.rows_loaded = self.total_rows if self.total_cols > LARGE_COLS: self.cols_loaded = self.COLS_TO_LOAD else: self.cols_loaded = self.total_cols
def __init__(self, dataFrame, format="%.3g", parent=None): QAbstractTableModel.__init__(self) self.dialog = parent self.df = dataFrame self.df_index = dataFrame.index.tolist() self.df_header = dataFrame.columns.tolist() self._format = format self.complex_intran = None self.total_rows = self.df.shape[0] self.total_cols = self.df.shape[1] size = self.total_rows * self.total_cols huerange = [.66, .99] # Hue self.sat = .7 # Saturation self.val = 1. # Value self.alp = .6 # Alpha-channel self.hue0 = huerange[0] self.dhue = huerange[1]-huerange[0] self.max_min_col = None if size < LARGE_SIZE: self.max_min_col_update() self.colum_avg_enabled = True self.bgcolor_enabled = True self.colum_avg(1) else: self.colum_avg_enabled = False self.bgcolor_enabled = False self.colum_avg(0) # Use paging when the total size, number of rows or number of # columns is too large if size > LARGE_SIZE: self.rows_loaded = self.ROWS_TO_LOAD self.cols_loaded = self.COLS_TO_LOAD else: if self.total_rows > LARGE_NROWS: self.rows_loaded = self.ROWS_TO_LOAD else: self.rows_loaded = self.total_rows if self.total_cols > LARGE_COLS: self.cols_loaded = self.COLS_TO_LOAD else: self.cols_loaded = self.total_cols
def __init__(self, data, format="%.3f", xlabels=None, ylabels=None, readonly=False, parent=None): QAbstractTableModel.__init__(self) self.dialog = parent self.changes = {} self.xlabels = xlabels self.ylabels = ylabels self.readonly = readonly self.test_array = np.array([0], dtype=data.dtype) # for complex numbers, shading will be based on absolute value # but for all other types it will be the real part if data.dtype in (np.complex64, np.complex128): self.color_func = np.abs else: self.color_func = np.real # Backgroundcolor settings huerange = [.66, .99] # Hue self.sat = .7 # Saturation self.val = 1. # Value self.alp = .6 # Alpha-channel self._data = data self._format = format try: self.vmin = self.color_func(data).min() self.vmax = self.color_func(data).max() if self.vmax == self.vmin: self.vmin -= 1 self.hue0 = huerange[0] self.dhue = huerange[1]-huerange[0] self.bgcolor_enabled = True except TypeError: self.vmin = None self.vmax = None self.hue0 = None self.dhue = None self.bgcolor_enabled = False
def __init__(self, data=[], parent=None): QAbstractTableModel.__init__(self, parent) self._data = data
def flags(self, index): """Set flags""" if index.column() == 0: return Qt.ItemIsEnabled | Qt.ItemIsSelectable return Qt.ItemFlags( QAbstractTableModel.flags(self, index) | Qt.ItemIsEditable)
def flags(self, index): """Set editable flag""" if not index.isValid(): return Qt.ItemIsEnabled return Qt.ItemFlags(QAbstractTableModel.flags(self, index)| Qt.ItemIsEditable)
def __init__(self, parent, dependencies): QAbstractTableModel.__init__(self, parent) self.dependencies = None self.set_data(dependencies)
def flags(self, index): """Set flags""" if index.column() == 0: return Qt.ItemIsEnabled | Qt.ItemIsSelectable return Qt.ItemFlags(QAbstractTableModel.flags(self, index) | Qt.ItemIsEditable)
def flags(self, index): """Qt Override.""" if not index.isValid(): return Qt.ItemIsEnabled return Qt.ItemFlags(QAbstractTableModel.flags(self, index))
def flags(self, index): """Set editable flag""" if not index.isValid(): return Qt.ItemIsEnabled return Qt.ItemFlags( QAbstractTableModel.flags(self, index) | Qt.ItemIsEditable)
def __init__(self): QAbstractTableModel.__init__(self) self.shortcuts = []