Skip to content

Commit 55346f5

Browse files
author
David Stirling
committed
Clear gates created with redux module when switching reduction methods (pca table does not persist)
1 parent c21ab73 commit 55346f5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

cpa/dimensionreduction.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,11 @@ def update_figpanel(self, evt=None):
814814
selected_plot = self.plot_choice.GetStringSelection()
815815

816816
if self.figpanel.calculated != selected_method:
817+
# Clear gates made with previous methods.
818+
for gate_name in list(p.gates.keys()):
819+
if PCA_TABLE in p.gates[gate_name].get_tables():
820+
p.gates.pop(gate_name)
821+
logging.warning(f'Reduction method changed, gate "{gate_name}" was removed.')
817822
self.figpanel.calculate(selected_method, dlg=dlg)
818823
if self.figpanel.calculated != selected_method:
819824
# Calculation failed for whatever reason

0 commit comments

Comments
 (0)