Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: merge in v2 "MVC" branch #82

Merged
merged 40 commits into from
Jan 9, 2025
Merged

refactor: merge in v2 "MVC" branch #82

merged 40 commits into from
Jan 9, 2025

Conversation

tlambert03
Copy link
Member

Merges in all of the changes from the v2-mvc into main.

tlambert03 and others added 30 commits July 15, 2024 09:40
* add summary info

* move canvas off front-end view

* propogate mouse events back to controller

* add mouse events on jupyter side

* minor tweaks

* reorg and touch up

* add test

* fix typing for 3.9

* fix again

* revert old data wrapper

* bump

* add typing extensions

* work for python 3.9

* typing again

* fix some update inconsistencies

* bump third party tests
* update pre-commit

* proof of principle working example for channels.  needs cleanup

* decent state

* create LutController

* extras, and no qt

* update readme

* fix test

* improve layout

* fix syncronization
* breakout channel controller

* update typos

* add qt enum
…upyter views (#64)

* wip

* mouseable pattern

* work with jupyter too

* run_app

* fix pygfx on jupyter

* dedupe

* future
* Port stats model

* Port histogram model/view

* Create QtHistogramView

Wraps the VispyHistogramView up with some Qt widgets for control.
Derived from the histogram example

* Create JupyterHistogramView

* Partition histogram frontends

* WIP: Refactor Stats computation

More view refactoring is likely necessary. A PStatsView might just want
to accept the dataclass, if we even see a need to maintain that view
protocol.

* Remove Unpack import

* Polish

* Remove Vertical button

I don't think that API needs to be accessible from the UI (by default)

* Rename VispyHistogramView -> Canvas

* Add TODO about ensuring VisPy installed

* trimmed down histogram

* use bincount

* better data

* merge in changes

* reduce

* remove test stats

* small changes

* working on mouse stuff

* connect mouse events

* cursor

* remove test

* connect gamma

* app changes

* remove print

* make work with jupyter again

* tile again

---------

Co-authored-by: Gabriel Selzer <[email protected]>
tlambert03 and others added 9 commits December 16, 2024 11:10
* test: test controller with mocks

* test matrix

* no pytest-qt

* setup headless

* fix test

* different check

* pick jupyter in absense of pytestqt

* remove test controller

* always setup headless

* pin pyside

* focus on pygfx

* install mesa vulkan

* just pygfx

* fix cov

* pass examples for now

* skip v1 with pyside

* switch to vispy

* ignore suitable pixel

* extend matrix

* cleanup pyproject

* use mac on 313

* skip all 3.10 pyside

* switch 3.13 again

* again

* switch matrix

* revert

* add comment about pyside
* test: test controller with mocks

* fix test

* add back examples

* remove controller

* skip examples on pyside

* allow leaks on v1

* bump
* feat: support wx

* specify extra

* fix try start

* thinner track

* add mouse events

* warn on bad data

* fixup

* add fixme

* add to test matrix

* skip wx on ubuntu

* fix wx test

* style(pre-commit.ci): auto fixes [...]

* remove condition

* change any_app

* add pytest-qt to dev

* add wxpythong 3.9

* fix 3.9

* add windows jup 3.9

* remove test of range_slider

* remove wx-signal

* fix pygfx

* style(pre-commit.ci): auto fixes [...]

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* feat: add CanvasProvider and GuiProvider classes

* pragmas

* fix unbound

* move mouse events

* allow jupyter provider without app in tests
* feat: support gpu clims

* Update _utils.py

Co-authored-by: Gabriel Selzer <[email protected]>

* fix downcast

* style(pre-commit.ci): auto fixes [...]

* fix for int16

* style(pre-commit.ci): auto fixes [...]

---------

Co-authored-by: Gabriel Selzer <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* imshow again

* move old_viewer to v1

* update

* fix init

* cleanup

* make ArrayViewer wrapper

* add gabe to authors

* close method and docs

* fix test

* fix test and vispy histogram

* move mvc

* tweak model

* update wrappers

* expose datawrapper

* remove additional layer

* fix tests

* fix error on channel guess

* rename and fixup

* fix pygfx

* fix leak catch when testing pygfx with vispy in environment

* style(pre-commit.ci): auto fixes [...]

* fix py3.9

* update pre-commit

* cleanup

* remove skip on examples

* fix import

* remove macos pyopencl

* skip pyside in examples

* remove NDViewer

* merge files

* remove public usage of ArrayDataDisplayModel

* refactor: rename ArrayDataDisplayModel to _ArrayDataDisplayModel and update data access patterns

* Update src/ndv/controllers/_array_viewer.py

Co-authored-by: Gabriel Selzer <[email protected]>

* add clone

* remove zarr astype

* add another filterwarning for zarr

* pin zarr

* style(pre-commit.ci): auto fixes [...]

* make add_histogram private

* make views module private

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Selzer <[email protected]>
@gselzer
Copy link
Collaborator

gselzer commented Jan 9, 2025

Let's do it! 💪

Copy link

codecov bot commented Jan 9, 2025

Codecov Report

Attention: Patch coverage is 69.25084% with 825 lines in your changes missing coverage. Please review.

Project coverage is 70.44%. Comparing base (cbd5460) to head (be0bc05).
Report is 64 commits behind head on main.

Files with missing lines Patch % Lines
src/ndv/_views/_vispy/_histogram.py 0.00% 226 Missing ⚠️
src/ndv/_views/_wx/range_slider.py 42.97% 142 Missing ⚠️
src/ndv/_views/_app.py 67.51% 102 Missing ⚠️
src/ndv/_views/_vispy/_plot_widget.py 0.00% 100 Missing ⚠️
src/ndv/controllers/_channel_controller.py 64.21% 34 Missing ⚠️
src/ndv/_views/_qt/_array_view.py 89.08% 25 Missing ⚠️
src/ndv/_views/_wx/_array_view.py 87.77% 22 Missing ⚠️
src/ndv/models/data_wrappers/_data_wrapper.py 87.42% 22 Missing ⚠️
src/ndv/v1/util.py 18.51% 22 Missing ⚠️
src/ndv/_views/_vispy/_array_canvas.py 76.82% 19 Missing ⚠️
... and 15 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #82      +/-   ##
==========================================
- Coverage   80.24%   70.44%   -9.80%     
==========================================
  Files          16       43      +27     
  Lines        2237     4253    +2016     
==========================================
+ Hits         1795     2996    +1201     
- Misses        442     1257     +815     

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

@tlambert03 tlambert03 merged commit 48d06d4 into main Jan 9, 2025
49 of 51 checks passed
@tlambert03 tlambert03 deleted the v2-mvc branch January 9, 2025 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants