Skip to content

feat: add ArrayViewer.stats_updated signal for external listeners#266

Open
tlambert03 wants to merge 19 commits intopyapp-kit:mainfrom
tlambert03:histogram-signal
Open

feat: add ArrayViewer.stats_updated signal for external listeners#266
tlambert03 wants to merge 19 commits intopyapp-kit:mainfrom
tlambert03:histogram-signal

Conversation

@tlambert03
Copy link
Copy Markdown
Member

@tlambert03 tlambert03 commented Mar 28, 2026

this PR adds a signal that gets emitted with the result of the image stats each time they are calculated. This allows, for example, an external histogram widget, or anything that wants to use image stats without having to recalculate them:

here's a new example showing a custom histogram

Untitled2.mov

our internal histogram widgets now use this internally.

TODO: for a follow-up PR, I noticed while doing this that, once a histogram is shown, even if it is later hidden, we never disconnect it from requesting stats. so there's a performance improvement waiting to happen if we just destroy the histogram widget each time it is hidden

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 28, 2026

Codecov Report

❌ Patch coverage is 78.37838% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.77%. Comparing base (8d46c1b) to head (d4f9c18).

Files with missing lines Patch % Lines
src/ndv/controllers/_array_viewer.py 68.00% 8 Missing ⚠️

❌ Your patch check has failed because the patch coverage (78.37%) is below the target coverage (85.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #266      +/-   ##
==========================================
- Coverage   85.85%   85.77%   -0.09%     
==========================================
  Files          50       50              
  Lines        5853     5876      +23     
==========================================
+ Hits         5025     5040      +15     
- Misses        828      836       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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