feat(squidxplorer): trade the mosaic view for the run, and hand the result off - #635
Open
jsschwrz wants to merge 2 commits into
Open
feat(squidxplorer): trade the mosaic view for the run, and hand the result off#635jsschwrz wants to merge 2 commits into
jsschwrz wants to merge 2 commits into
Conversation
An acquisition whose mosaic view would not fit in available RAM used to be blocked outright: a modal "Not Enough RAM" error, the Start button un-checked, and no run. Only the live preview was unaffordable, though — the instrument could perform the acquisition perfectly well. The operator's only recourse was to read the hint at the bottom of the message, find the Performance Mode button themselves, and press Start again. Treat it as a resource-allocation decision instead. The operator is told "Mosaic View will be disabled for this Run", Performance Mode is enabled on their behalf, the run proceeds, and Performance Mode is restored when it ends. A run that had Performance Mode on manually is left as it was. Because the mosaic they gave up is exactly what SquidXplorer renders from disk, the completed run then offers to open there — with a "don't ask again this session" opt-out. SquidXplorer needs a newer Python than this software runs on and lives in its own venv, so it is launched out of process via the new squidxplorer_python setting ([GENERAL]), falling back to squidmip-view on PATH. The launcher uses the list form of Popen deliberately: SquidXplorer reads its dataset from a bare sys.argv[1], and a path split across argv makes it open empty with no error at all. A launch that dies immediately — almost always its single-window lock — is reported, with the run folder left on the clipboard so it can be dropped onto the window that is already open. check_ram_available_with_error_dialog becomes mosaic_ram_exceeds_available: it reports the condition and no longer both decides and vetoes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
SquidXplorer allows one GUI per lock directory and that directory defaults to ~/.cache/squidmip, which every checkout on a machine shares. Pointing the "Open in Xplorer" handoff at a viewer that also has a desktop shortcut meant the second launch lost the race and silently no-opped. squidxplorer_gui_lock_dir under [GENERAL] is now exported to the viewer process as SQUIDMIP_GUI_LOCK_DIR, so the handoff gets its own slot. Set nothing and the launch environment is inherited untouched, as before. Doing it this way rather than shelling out to a .cmd wrapper keeps the list-form Popen: the viewer reads a bare sys.argv[1], so a run folder with a space in it must not go via a shell. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two commits, five files. Split out of a customer build branch; the branch is cut from current master and contains nothing else.
When a run will not fit in RAM alongside the napari mosaic view, the mosaic is traded away for the duration of the run instead of the run being refused outright — the operator gets the acquisition rather than a dialog. When it ends, the finished folder is offered to SquidXplorer.
3b7be3c6follows up by giving the handoff its own GUI lock directory, so launching SquidXplorer cannot collide with the main application's single-instance lock.Note for review:
mosaic_ram_exceeds_available()is the oldcheck_ram_available_with_error_dialog()renamed — it now reports whether the mosaic fits rather than showing a dialog, because the caller decides what to do about it.