ShowDiffraction tutorial, CLI integration - #195
Open
henryhng wants to merge 487 commits into
Open
Conversation
The LRU paging engine (Dataset5dstem.page/frame/vram_resident) existed but was never called on dataset switch, so a many-master folder loaded every 4D dataset into VRAM at once and switching the slider did not free the old one - VRAM filled and stayed full. Now: new page_budget kwarg on Show4DSTEM. When set on a multi-dataset Dataset5dstem, __init__ enables page(page_budget) and the per-frame accessors (_frame_data, _virtual_image_for_frame, the histogram-init frame) go through .frame(idx) instead of [idx]. Switching the slider pages the target dataset onto the GPU and evicts the least-recently-used one to RAM, so only page_budget datasets are ever resident and the footprint stays flat. Default (page_budget=None) is unchanged: every dataset stays resident for instant switching. .frame() is identical to [idx] when paging is off, so the single-dataset and plain-5D-tensor paths are untouched. Tested: 33 existing 4dstem/dataset5dstem tests pass, real gold_512 single-dataset Show4DSTEM unchanged, + new tests/test_show4dstem_paging.py (no-budget=all-resident, budget=1 evicts LRU with flat VRAM, budget=2 keeps 2).
…ged viewer ShowFolder had Open Show2D/Show3D/both but no 4D handoff, so a folder of *_master.h5 scans could not be opened as Show4DSTEM. New: - ShowFolderBrowser.open_show4dstem(gpus=, page_budget=, det_bin=, dtype=, scan_size=): discovers every ready master in the folder, loads each round- robin across gpus (one dataset per card = N x capacity), wraps them in a Dataset5dstem, and builds Show4DSTEM(page_budget=...). Switching the dataset slider pages the target onto the GPU and evicts the least-recently-used one to RAM (the paging wired in 090a4f1), so a 40-master folder never fills VRAM. - 'Open Show4DSTEM' button in the selection panel; defaults gpus=current, page_budget=1 so switching always evicts. Half-written masters (missing sibling data files) are skipped so a live acquisition folder is safe. Tested end-to-end: 41 real PE-5 masters -> one Show4DSTEM, page_budget=1 keeps 1 resident, switching evicts (resident [0]->[2]). 46 existing showfolder/4dstem tests pass. New tests: multi-master paged build (mocked io) + no-masters None.
…els so they don't jiggle (Show2D + Show3D)
…er toggle reveals its settings row like Denoise (Show2D + Show3D)
…lider no longer disabled when mode is none); Show2D + Show3D
…boxes from a duplicate menu on the same anchor
…te keeps denoise ON (was gated off in exports; also fixes More badge undercount)
…stale-array fallback broadcast v; now fills neutral, preserves per-panel values)
# Conflicts: # CHANGELOG.md # README.md # docs/tutorials/showdiffraction.ipynb
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.
No description provided.