Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Refactor mda_folder.selectionField #111

@rodolakis

Description

@rodolakis
    def selectionField(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.
        """
        return self._selection_field

    def setSelectionField(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_selection if new_selection != {} else None

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

Upgrades

Relationships

None yet

Development

No branches or pull requests

Issue actions