Skip to content

Comments

Removed NYX related code#421

Open
vshekar wants to merge 4 commits intoNSLS2:masterfrom
vshekar:remove-nyx-code
Open

Removed NYX related code#421
vshekar wants to merge 4 commits intoNSLS2:masterfrom
vshekar:remove-nyx-code

Conversation

@vshekar
Copy link
Collaborator

@vshekar vshekar commented Jan 13, 2026

This pull request removes support for the "nyx" beamline throughout the codebase. All configuration, logic, and conditional code paths specific to "nyx" have been removed, leading to a significant simplification and streamlining of the code. The changes affect configuration files, device initialization, data collection logic, GUI components, and utility functions.

The most important changes are:

Configuration and Constants Cleanup:

  • Removed all "nyx" entries from configuration dictionaries, such as DETECTOR_SAFE_DISTANCE, DEWAR_SECTORS, cryostreamTempPV, VALID_EXP_TIMES, VALID_DET_DIST, VALID_TOTAL_EXP_TIMES, VALID_TRANSMISSION, MINIMUM_RASTER_SIZE, and LSDC_SERVICE_USERS in config_params.py.
  • Removed OPHYD_COLLECTIONS dictionary and related logic for "nyx". [1] [2]

Device and Motor Initialization:

  • Eliminated special-case initialization for MD2 motors and devices for "nyx" in beamline_support.py and gon_lib.py. Now, all motors use the generic EpicsMotor or generic device classes. [1] [2]
  • Removed conditional imports and usage of MD2 and related devices in the GUI and other modules.

Data Collection and Protocol Logic:

  • Removed "nyx"-specific data collection logic, including protocol handling, spotfinding, and characterization strategies. All protocol and collection logic now applies only to "amx" and "fmx". [1] [2] [3] [4] [5]

GUI Simplification:

  • Removed all GUI code paths and UI elements specific to "nyx", such as disabling widgets, setting default values, and handling beam size options. The GUI now only supports "amx" and "fmx". [1] [2] [3] [4] [5] [6]

Utility and Miscellaneous Code:

  • Removed "nyx"-specific logic from utility functions, environment initialization, and function whitelisting. This includes global variable management and function registration. [1] [2] [3] [4]

These changes collectively remove all support and code paths for the "nyx" beamline, resulting in a more maintainable and focused codebase.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 16 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (2)

gui/control_main.py:3126

  • The logic for determining raster cell direction is broken after removing NYX-specific code. The condition if i % 2 == 0 on line 3116 is followed by an else block that still checks for NYX beamline (line 3119), but NYX support has been removed. This will always set is_raster_inverted = 0 since the NYX branch is unreachable. The subsequent nested if-else (lines 3123-3126) becomes redundant because i % 2 == is_raster_inverted is equivalent to i % 2 == 0, making the else branch unreachable. This should be simplified to remove the NYX check and the redundant nested conditions.
                if i % 2 == 0:  # this is trying to figure out row direction
                    cellIndex = spotLineCounter
                else:
                    if daq_utils.beamline == "nyx":
                        is_raster_inverted = 1
                    else:
                        is_raster_inverted = 0
                    if i % 2 == is_raster_inverted:  # this is trying to figure out row direction
                        cellIndex = spotLineCounter
                    else:
                        cellIndex = rowStartIndex + ((numsteps - 1) - j)

gon_lib.py:18

  • Undefined variable references. The functions backlightBrighter() and backlightDimmer() reference back_light and back_light_range variables (lines 11-13, 16-18), but these were removed from the imports at the top of the file. These variables were previously imported from start_bs when beamline was 'nyx', but that import has been removed. These variables need to be imported or defined for AMX and FMX beamlines.
def backlightBrighter():
  intensity = back_light.get()
  intensity += BACK_LIGHT_STEP * (back_light_range[1]-back_light_range[0])
  back_light.put(intensity)  

def backlightDimmer():
  intensity = back_light.get()
  intensity -= BACK_LIGHT_STEP * (back_light_range[1]-back_light_range[0])
  back_light.put(intensity)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant