Repository navigation
Add Plot2D.reset_tile_band, to re-derive the tile band when the dataset changes - #89
Merged
Merged
Conversation
…et changes Tile mode encodes pixels to 8 bits over a band fixed from the first frame and then held, so a contrast change is a LUT re-window. Every later frame on a tiled plot keeps that band, a smaller one too. When a host switches the plot to a different dataset that is wrong: SpyDE's detector binned 4 x 4 has 16 times the counts, every pixel clipped to the top code, and the display window set for the binned frames drew them black. reset_tile_band() clears the band; the next set_data or update_tile_source derives it from the new frame through the existing _ensure_tile_band. Tile mode, the zoom and the detail tile are kept. A no-op off tile mode. SpyDE can then stop calling _disable_tile().
CSSFrancis
added a commit
to directelectron/spyde
that referenced
this pull request
Dec 3, 2026
CSSFrancis/anyplotlib#89 adds Plot2D.reset_tile_band, which clears the held band and keeps tile mode, the zoom and the detail tile. The plot uses it on a node switch, and leaves tile mode (the private _disable_tile) only with an anyplotlib that predates it. Both pass test_rebin_display_band.py; with #89 the rebin, tile, LOD, viewport and movie tests pass (164) and the app check shows the 2 x 2 and 4 x 4 bins correctly.
…ls Chromium ubuntu-latest became Ubuntu 26.04, and `playwright install chromium --with-deps` (Playwright 1.58.0) refuses it: "Playwright does not support chromium on ubuntu26.04-x64". Every Linux test job and the docs build failed at that step before a test ran. Pinning the runners that install Playwright keeps the browser and the screenshot baselines as they are; lift the pin when a Playwright release supports 26.04.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #89 +/- ##
=======================================
Coverage 92.07% 92.08%
=======================================
Files 42 42
Lines 5489 5493 +4
=======================================
+ Hits 5054 5058 +4
Misses 435 435 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
Tile mode encodes pixels to 8 bits over a band (
raw_min/raw_max) that it fixes from the first frame and then holds, so a contrast change is only a LUT re-window. Every later frame on a tiled plot keeps that band, smaller frames included.That's right while the frames come from one source, and wrong when a host switches the plot to a different dataset. In SpyDE, binning the detector 4 × 4 gives 16 times the counts:
A coworker reported this as "binning the data still turns the signal black". The SpyDE fix (directelectron/spyde#270) currently reaches into the private
_disable_tile()to escape the held band.Plot2D.reset_tile_band()clears the band.set_dataorupdate_tile_sourcederives it from the new frame, through the existing_ensure_tile_band.set_tile_band(pin a known range) with "forget the range, take the next frame's".Tests
TestResetTileBandintest_tiled_imshow.py:test_tiled_imshow.py,test_display_window.py,test_detail_tile.pyandtest_tile_backend.py: 125 passed.