Skip to content

Conversation

@gselzer
Copy link
Collaborator

@gselzer gselzer commented Oct 16, 2025

This PR is one step of an attempt at breaking #28 up into chunks. This chunk contains the widget toolkit logic necessary for implementing events. Notably, this logic is mostly sitting on the sidelines and does not affect the existing example code.

The scenex.app package

This new package mostly contains functionality adapted from ndv. The NDVApp class has been renamed to App, and the correct app for a given python environment can be retrieved from scenex.app.app(). The returned App can start an event loop, call functions on the main thread, etc. etc. We only need some of this functionality here in scenex (the rest is needed for ndv), but the design favors centralizing all that logic into one package that could be easily split out later.

The scenex.app.events package

This package contains dataclasses designed to abstract the event functionality of the various widget toolkits, inspired by similar classes in ndv. Without the rest of #28 they don't get much use here, although I did migrate their test suite as well. It may be nice to evaluate their design in an abstract sense as well.

@tlambert03 please let me know if you'd rather review this chunk of functionality instead of #28 as a whole. It's not quite ready for merge because there are a few more bugs to work out:

  • Vispy+Qt: Mouse scrolling doesn't work for some reason. Works in feat: events #28
  • Vispy+Jupyter: Canvas doesn't show due to an error coming out of gloo. Also doesn't work in feat: events #28.

@codecov
Copy link

codecov bot commented Oct 17, 2025

Codecov Report

❌ Patch coverage is 80.37037% with 106 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.11%. Comparing base (4e431fb) to head (cb1e568).

Files with missing lines Patch % Lines
src/scenex/app/_qt.py 66.66% 43 Missing ⚠️
src/scenex/app/_wx.py 73.60% 33 Missing ⚠️
src/scenex/app/_jupyter.py 89.09% 12 Missing ⚠️
src/scenex/app/_auto.py 89.33% 8 Missing ⚠️
src/scenex/app/events/_events.py 86.00% 7 Missing ⚠️
src/scenex/adaptors/_pygfx/_canvas.py 93.10% 2 Missing ⚠️
src/scenex/adaptors/_auto.py 50.00% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (80.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      #38      +/-   ##
==========================================
- Coverage   80.72%   79.11%   -1.61%     
==========================================
  Files          42       49       +7     
  Lines        1520     2040     +520     
==========================================
+ Hits         1227     1614     +387     
- Misses        293      426     +133     

☔ 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.

@gselzer
Copy link
Collaborator Author

gselzer commented Nov 4, 2025

@tlambert03 did you ever see this?

@tlambert03
Copy link
Member

I did see it, and I am very sorry that I haven't reviewed it yet! Thank you for the ping and for bringing it back to my attention, and thanks a lot for trying to break up that pr a little bit!

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.

2 participants