Skip to content

Select main.py directly in the TOPAZ reduction dialog - #9

Merged
jmborr merged 1 commit into
mainfrom
mainSelector
Nov 13, 2026
Merged

jmborr merged 1 commit into
mainfrom
mainSelector

Conversation

@jmborr

@jmborr jmborr commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #8.
Implements EWM 19092

Reduction > TOPAZ opened a directory selector (QFileDialog.getExistingDirectory). That kind of dialog shows files greyed out, so users thought they could not load main.py, when they were actually expected to select the folder that contains it.

This PR replaces it with a file selector:

  • The dialog is titled "Select TOPAZ reduction main.py" and its filter shows main.py by default, with an "All files (*)" option.
  • When the user enters a folder that contains main.py, the file is selected automatically, so clicking Open launches it right away. This also applies to the starting folder.
  • If the user picks a file not named main.py, a warning appears and nothing is launched.
  • The dialog uses DontUseNativeDialog, because only Qt's own dialog sends the directoryEntered signal that the automatic selection depends on. The other file dialogs in NeuXtalViz already do this.

What happens after Open is unchanged: main.py is still run with mantidpython, with its folder as the working directory, and that folder is remembered for the next time the dialog opens.

Testing

  • I reproduced the greyed-out files locally by running src/NeuXtalViz.py in a local copy of the scd-reduction-tools Pixi environment (Mantid 7.0, PyQt6), the same way /SNS/software/scd/neuxtalviz.sh launches it.
  • With the change, entering /SNS/TOPAZ/IPTS-31856/shared/ReductionGUI selects main.py automatically.
  • I didn't test the launch itself locally, because mantidpython comes from the system Mantid installation on the analysis nodes (/bin/mantidpython) and isn't installed here.

🤖 Generated with Claude Code

The Reduction > TOPAZ action used a directory selector, which shows
files greyed out and led users to believe they could not load main.py.
Replace it with a file selector filtered to main.py that automatically
selects main.py whenever the user enters a directory containing it.
The launch behavior is unchanged: main.py is run with mantidpython
from its parent directory.

Closes #8

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jmborr jmborr self-assigned this Nov 13, 2026
@jmborr
jmborr merged commit 815980f into main Nov 13, 2026
8 checks passed
@jmborr
jmborr deleted the mainSelector branch November 13, 2026 21:35
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.

Files greyed out in File selector

1 participant