Skip to content

Commit

Permalink
Merge pull request #32646 from mantidproject/32645_phasequadBug
Browse files Browse the repository at this point in the history
muon phasequad bug
  • Loading branch information
DavidFair authored Sep 28, 2021
2 parents 32109b8 + 61fba73 commit 330e5a3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/release/v6.2.0/muon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Bugfixes
- The attribute values in a :ref:`Chebyshev <func-Chebyshev>` fitting function will no longer reset after performing a simultaneous fit.
- Fixed a crash caused by fitting to rebinned :ref:`PhaseQuad <algm-PhaseQuad>` data.
- When :ref:`PhaseQuad <algm-PhaseQuad>` data is rebinned it now divides by the fractional change in the bin size (to keep the asymmetry to about 0.3).
- Fixed a bug that is caused by changing instrument and loading a run, after creating a phasequad.

ALC
---
Expand Down
4 changes: 4 additions & 0 deletions scripts/Muon/GUI/Common/contexts/muon_group_pair_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ def selected_groups_and_pairs(self):
def clear(self):
self.clear_groups()
self.clear_pairs()
self.clear_phasequads()

def clear_phasequads(self):
self._phasequad = []

def clear_groups(self):
self._groups = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,11 @@ def setup_instrument_changed_notifier(self):
self.context.data_context.instrumentNotifier.add_subscriber(
self.home_tab.home_tab_widget.instrumentObserver)

self.clear_observer = GenericObserver(self.clear)

self.context.data_context.instrumentNotifier.add_subscriber(
self.clear_observer)

self.context.data_context.instrumentNotifier.add_subscriber(
self.load_widget.load_widget.instrumentObserver)

Expand All @@ -389,6 +394,9 @@ def setup_instrument_changed_notifier(self):
for observer in self.plot_widget.clear_plot_observers:
self.context.data_context.instrumentNotifier.add_subscriber(observer)

def clear(self):
self.context.clear_context()

def setup_group_calculation_enable_notifier(self):
self.grouping_tab_widget.group_tab_presenter.enable_editing_notifier.add_subscriber(
self.enable_observer)
Expand Down
8 changes: 8 additions & 0 deletions scripts/Muon/GUI/MuonAnalysis/muon_analysis_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@ def setup_instrument_changed_notifier(self):
self.context.data_context.instrumentNotifier.add_subscriber(
self.home_tab.home_tab_widget.instrumentObserver)

self.clear_observer = GenericObserver(self.clear)

self.context.data_context.instrumentNotifier.add_subscriber(
self.clear_observer)

self.context.data_context.instrumentNotifier.add_subscriber(
self.load_widget.load_widget.instrumentObserver)

Expand All @@ -396,6 +401,9 @@ def setup_instrument_changed_notifier(self):
for observer in self.plot_widget.clear_plot_observers:
self.context.data_context.instrumentNotifier.add_subscriber(observer)

def clear(self):
self.context.clear_context()

def setup_group_calculation_enable_notifier(self):

self.grouping_tab_widget.group_tab_presenter.enable_editing_notifier.add_subscriber(
Expand Down

0 comments on commit 330e5a3

Please sign in to comment.