Skip to content

Commit

Permalink
enh: only preselect innate features when computing statistics (close #…
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Nov 16, 2023
1 parent 61aae51 commit dafd81b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
2.14.1
- fix: perform sanity check for contour spacing before plotting
- enh: minor optimization of min/max feature algorithm
- enh: only preselect innate features when computing statistics (#150)
- setup: bump dclab to 0.55.6 (new scalar features, dcor access)
2.14.0
- ref: don't set RTDCBase.identifier to slot identifier
Expand Down
19 changes: 18 additions & 1 deletion shapeout2/gui/compute/comp_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def __init__(self, parent, pipeline, *args, **kwargs):
else:
self.comboBox.setCurrentIndex(0)
self.on_combobox() # computes self.features
self.bulklist_features.on_select_all()
# Only select innate features
self.on_select_features_innate()

def done(self, r):
if r:
Expand Down Expand Up @@ -173,6 +174,22 @@ def on_combobox(self):
self.widget_other.hide()
self.update_feature_list(use_pipeline=True)

def on_select_features_innate(self):
"""Only select all innate features of the first dataset"""

if self.pipeline.num_slots:
ds = self.pipeline.get_dataset(0)
features_innate = ds.features_innate
lw = self.bulklist_features.listWidget
for ii in range(lw.count()):
wid = lw.item(ii)
for feat in features_innate:
if wid.data(101) == feat:
wid.setCheckState(QtCore.Qt.CheckState.Checked)
break
else:
wid.setCheckState(QtCore.Qt.CheckState.Unchecked)

def update_feature_list(self, use_pipeline=True):
if use_pipeline:
self.features = self.pipeline.get_features(scalar=True,
Expand Down

0 comments on commit dafd81b

Please sign in to comment.