You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defselectionField(self):
""" Retrieves the current field selection for plotting. - Returns a dictionary with selected positioner and detectors indices. - Format: {'X': positioner_index, 'Y': [detector_indices]}. - Returns None if no selection is made. """returnself._selection_fielddefsetSelectionField(self, new_selection=None):
""" Updates the current field selection for plotting. - Accepts a dictionary specifying new selection of positioner and detectors. - Resets to None if given an empty dictionary. - Format for new_selection: {'X': positioner_index, 'Y': [detector_indices]}. """# TODO - how to enfore selectionField structure? Turn it into a class!# what if new_selectionvdoes not have X or Y key, or any of those key return# a None value? or is {}?self._selection_field=new_selectionifnew_selection!= {} elseNone
Activity
rodolakis commentedon Jul 24, 2025
Current State:
self.selections(inMDAFileTableModel):{1: 'X', 2: 'Y', 4: 'Y', 4: 'I0'}- row-based formatself.selectionField()(inMDA_MVC):{'Y': [2, 3], 'X': 1, 'I0': 4}- column-based formatftm2mda()andmda2ftm(): Convert between these two formatsProblems with Current Approach:
Option 1: Unify to Single Format (Recommended)
{'Y': [2, 3], 'X': 1, 'I0': 4}) seems more natural because:Option 2: Create a Selection Manager Class
[-]Make `mda_folder.selectionField` a class[/-][+]Refactor `mda_folder.selectionField`[/+]