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

Add option to use npe2 shim/adaptor for npe1 plugins #4564

Merged
merged 35 commits into from
Jun 18, 2022

Conversation

tlambert03
Copy link
Contributor

@tlambert03 tlambert03 commented May 23, 2022

Description

A "softer/gentler" version of #4015. This PR adds a new setting (settings.plugin.use_npe2_adaptor) that lets the user opt-in to the npe2-adaptor behavior. It defaults to False, but when set to True, it will essentially treat all plugins as npe2 plugins. This means that:

  • upon first import after enabling this setting, npe1 plugins will imported as usual, but their contributions will be indexed and stored in a cached npe2 "shim" manifest (see NPE1Adapter Part 3 - caching of adapter manifests npe2#126).
  • after the first time running napari with this option on, later boots of napari will incur no penalty for importing and discovering plugin contributions. 🎉
  • each plugin will be imported lazily, only when one of their contributions is requested.
  • (adapter caches can be managed using npe2 cache --help)
  • the discovery method on the old napari.plugins.plugin_manager becomes a no-op. In a later version, i hope to make this shim the only option for npe1, at which point all the npe1-specific code in the repo can go away (like [WIP] Use npe2 shim/adaptor for npe1 plugins. remove npe1 plugin code! #4015)

Type of change

  • Bug-fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

References

How has this been tested?

  • example: the test suite for my feature covers cases x, y, and z
  • example: all tests pass with my change

Final checklist:

  • My PR is the minimum possible work for the desired functionality
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • If I included new strings, I have used trans. to make them localizable.
    For more information see our translations guide.

@github-actions github-actions bot added preferences Issues relating to the creation of new preference fields/panels qt Relates to qt labels May 23, 2022
@codecov
Copy link

codecov bot commented May 23, 2022

Codecov Report

Merging #4564 (0e99a2c) into main (640484c) will increase coverage by 1.57%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##             main    #4564      +/-   ##
==========================================
+ Coverage   86.07%   87.64%   +1.57%     
==========================================
  Files         587      587              
  Lines       50384    50412      +28     
==========================================
+ Hits        43366    44184     +818     
+ Misses       7018     6228     -790     
Impacted Files Coverage Δ
napari/_qt/dialogs/qt_plugin_dialog.py 62.36% <40.00%> (-0.08%) ⬇️
napari/plugins/__init__.py 82.35% <75.00%> (-2.03%) ⬇️
napari/_qt/menus/plugins_menu.py 92.95% <100.00%> (+0.10%) ⬆️
napari/plugins/_npe2.py 88.77% <100.00%> (+0.23%) ⬆️
napari/settings/_base.py 92.01% <100.00%> (+0.54%) ⬆️
napari/settings/_plugins.py 96.29% <100.00%> (+0.14%) ⬆️
napari/plugins/pypi.py 45.61% <0.00%> (-0.82%) ⬇️
napari/utils/config.py 100.00% <0.00%> (ø)
napari/layers/utils/string_encoding.py 100.00% <0.00%> (ø)
napari/components/experimental/monitor/_api.py 0.00% <0.00%> (ø)
... and 55 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 640484c...0e99a2c. Read the comment docs.

Copy link
Contributor

@DragaDoncila DragaDoncila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this. Pulled it down and it works like a charm. Only "issue" I've discovered is that plugins are now indexed strictly by package name, whereas for npe1 plugins I think it was module? E.g. a "shimmed" napari_tifffile now shows up as napari-tifffile. Not a huge deal, but can break preferences.

@@ -808,7 +813,9 @@ def _add_to_installed(distname, enabled, npe_version=1):
if distname in self.already_installed or distname == 'napari':
continue
enabled = not pm2.is_disabled(manifest.name)
_add_to_installed(distname, enabled, npe_version=2)
# if it's an Npe1 adaptor, call it v1
npev = 'shim' if 'npe1' in type(manifest).__name__.lower() else 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is type(manifest).__name__.lower() actually checking sorry? Just curious how we're discerning between the different manifests, I have no issue with it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's checking the name of the class, to make sure it's NPE1Adapter 😂 ... it could be an isinstance, but requires an import from private module. I dunno 🤷

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's fine, but I think it would be more explicit to just have 'shim' if type(manifest).__name__ == 'NPE1Adapter' else 2 and then even a comment that we're avoiding a private import

napari/_qt/dialogs/qt_plugin_dialog.py Outdated Show resolved Hide resolved
@DragaDoncila
Copy link
Contributor

DragaDoncila commented May 26, 2022

Ok a bigger issue is that now builtins doesn't work, and napari (the npe2 plugin) only declares ['*.csv', '*.npy'] in its filename_patterns.

Also, oddly, if I call

viewer.open('../data/man_seg002.tif', plugin='napari')

I get

ValueError: There is no registered plugin named 'napari'.
Names of plugins offering readers are: set()

but if I have napari-tifffile installed and run viewer.open('../data/man_seg002.tif', plugin='napari'), it opens with napari-tifffile?

viewer.open('../data/man_seg002.tif', plugin='napari')
Out[3]: [<Image layer 'man_seg002 [1]' at 0x7fa5146ba260>]

viewer.layers[-1].source
Out[4]: Source(path='../data/man_seg002.tif', reader_plugin='napari-tifffile', sample=None, widget=None)

FWIW I don't think this is directly tied to this PR, but maybe just leftover because we still have both builtins and napari lying around? I'm just wondering whether, now that we're shimming, this will become even muddier.

See also #4575 where @jni and I realized we probably need to show both.

@tlambert03
Copy link
Contributor Author

with #4668 merged into this PR, these issues seem fixed. @DragaDoncila can you confirm?

@DragaDoncila
Copy link
Contributor

@tlambert03 yep, definitely. The issue was more with our manifest than with the shim. I didn't realize initially that in builtins.yaml we were pointing to the same reader function as we always have, and just hadn't correctly added all the filename patterns.

@DragaDoncila
Copy link
Contributor

DragaDoncila commented Jun 10, 2022

Although I had already opened a PR for this... But we just missed it in release. @tlambert03 see #4580

@github-actions github-actions bot added the tests Something related to our tests label Jun 11, 2022
@tlambert03
Copy link
Contributor Author

with #4668 merged into main, I think this is working. Would be good to get some eyes on this from @napari/core-devs

@github-actions github-actions bot removed the tests Something related to our tests label Jun 12, 2022
Copy link
Contributor

@DragaDoncila DragaDoncila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this, works as expected and is super exciting 🎉 . I have just a few comments, which I don't think need to be addressed now, while this is still optional, but should be addressed before we remove the original napari_plugin_manager entirely:

  • When setting the preference for the first time, or installing new plugins (in the GUI), a restart is required for the plugins to be shimmed. We may want to add a warning or some such, and ideally for newly installed plugins, they would be shimmed on install so the user doesn't have to restart.
  • I played around with a few plugins and most converted just fine. However, when I installed btrack and then restarted napari, I got napari.manifest -> 'btrack' could not be imported: Could not find file 'napari.yaml' in module 'btrack' in the terminal. I assume there was some conversion issue, but it would be nice if this was flagged more prominently for the GUI user somehow...
  • I think some plugins will now change their registered name in the plugin manager, and this may lead to preferences being incorrect. In the GUI I think this is okay as the user will be prompted to select a different plugin (so they have an out), but maybe we could let them know explicitly why this is happening, or convert their preferences silently maybe? Not sure about that last bit.

@@ -808,7 +813,9 @@ def _add_to_installed(distname, enabled, npe_version=1):
if distname in self.already_installed or distname == 'napari':
continue
enabled = not pm2.is_disabled(manifest.name)
_add_to_installed(distname, enabled, npe_version=2)
# if it's an Npe1 adaptor, call it v1
npev = 'shim' if 'npe1' in type(manifest).__name__.lower() else 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's fine, but I think it would be more explicit to just have 'shim' if type(manifest).__name__ == 'NPE1Adapter' else 2 and then even a comment that we're avoiding a private import

plugin_manager._initialize()

if settings.plugins.use_npe2_adaptor:
# prevent npe1 plugin_manager discovery
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So just to clarify, if I use this option I will never see an npe1 plugin (what a dream...). For my own reference, do we have an idea of what percentage of current npe1 plugins (if any) cannot be auto converted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my own reference, do we have an idea of what percentage of current npe1 plugins (if any) cannot be auto converted?

when I created the shim, I tested all plugins (here: napari/npe2#132) ... at the time 21 out of the 143 plugins tested actually need the shim thing at all (in the sense that they had locally defined contributions). all the rest have direct python_names for all their assets. And the shim strategy appeared to work for all 21 of those. So, based on those tests, this should work fine for all plugins. The one exception is napari tools menu, which is not actually a plugin, but a monkeypatch that just hijacks the loading system

@tlambert03
Copy link
Contributor Author

I got napari.manifest -> 'btrack' could not be imported: Could not find file 'napari.yaml' in module 'btrack'

@tlambert03
Copy link
Contributor Author

I got napari.manifest -> 'btrack' could not be imported: Could not find file 'napari.yaml' in module 'btrack'

thanks will have a look

@tlambert03
Copy link
Contributor Author

I played around with a few plugins and most converted just fine. However, when I installed btrack and then restarted napari, I got napari.manifest -> 'btrack' could not be imported: Could not find file 'napari.yaml' in module 'btrack' in the terminal. I assume there was some conversion issue, but it would be nice if this was flagged more prominently for the GUI user somehow...

looked into this. It's unrelated to this PR and is a packaging issue in btrack. Fixed submitted quantumjot/btrack#153

Copy link
Member

@jni jni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this too. As noted in private conversation with @tlambert03, it would be good if the option linked to text that explained the consequences of that choice, which are:

  • shimmed plugin widgets lose the ability to specify in which docked area they live (left, right, bottom)
  • reader call order isn't a thing anymore

Both of those are going away though so I'm happy to ease users into the transition with this. Good stuff.

Copy link
Contributor

@nclack nclack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this so much.

Agree with @jni, it would be good to note the behavioral differences for the user. The startup behavior is another thing that should be added to that list - especially since it should be a positive for most folks.

napari/settings/_plugins.py Show resolved Hide resolved
Copy link
Member

@andy-sweet andy-sweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand all the implications of this PR, but the changes looks good. Maybe a missing translation.

napari/_qt/dialogs/qt_plugin_dialog.py Outdated Show resolved Hide resolved
napari/_qt/dialogs/qt_plugin_dialog.py Show resolved Hide resolved
@tlambert03
Copy link
Contributor Author

I added a document with some additional explanation at https://github.com/napari/napari/pull/4564/files#diff-37b9bdb893f94908825ca80e038f5912fcf30bbc91f34eb313529680c16a14d1

I'm not sure how to link to it in the preferences pane (I tried an anchor tag but it doesn't work). The tooltip does pop up, but only if you hover over the checkbox (not the label). I think it's a bit out of scope here to figure out how to add web links to the preferences pane. so hopefully having the document there is enough

Copy link
Member

@jni jni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@jni
Copy link
Member

jni commented Jun 17, 2022

Thanks everyone for the reviews! I'll give this another ~24h before merging (or @tlambert03 feel free to self-merge if it's just sitting here without comment).

The macos 3.10 build is failing which what appears to be a numcodecs compilation error? That could be due to an updated macos image. I notice that there's no 3.10 wheels for numcodecs, but a new release is being worked on (0.10.0a3 was released in March, and does have 3.10 wheels), so presumably this problem will resolve itself. If we want to fix it beforehand, installing numcodecs with conda is an option. But either way, the failure is unrelated to this PR.

@tlambert03 tlambert03 merged commit e0cc713 into napari:main Jun 18, 2022
@tlambert03 tlambert03 deleted the npe2-shim-optional branch June 18, 2022 02:06
@Carreau Carreau added this to the 0.4.17 milestone Jun 28, 2022
tlambert03 added a commit to tlambert03/napari that referenced this pull request Jul 8, 2022
* Clean status message after leave canvas (napari#4607)

* Raise error when rgb True but data not correct dims (napari#4630)

* add ci for asv benchmark suite (napari#4554)

* add ci for asv benchmark suite

* ignore git-lfs stuff?

* split qt from non-qt

* asv: provide custom uninstall command too

* fix yml

* matrix goes under strategy!

* ugh, it's 'uninstall', not 'remove'

* disable build_command

* underscore...

* it has to be a binary in PATH?

* use a different null command

* always yes for pip

* setup qt libs

* use xvfb

* try GabrielBB/xvfb-action

* parameterize 'run'

* add asv quick checks to PR CI

* use osx for qt benchmarks?

* adjust conf path

* fix asv check

* better comment

* add asv run quick to see how long it takes

* asv machine first

* split into another job

* oops typo

* move 'asv checks' to comprehensive

* used sed -E for linux/osx compat

* fix time_on_mouse_move

* skip some tests due to OOM on CI

* handle OOM errors in Labels3DSuite too

* increase timeout

* remove None case from TextManagerSuite

* prevent out of bounds error by allowing only one run per setup in time_remove_as_batch

* configure for label-based triggers

* draft support for scheduled runs and workflow_dispatch

* typo

* fix assigned var

* add delegated workflow that enables comments on PR

* message.txt only needed in PRs

* add some more comments

Co-authored-by: andy-sweet <andy-sweet@users.noreply.github.com>

* do not indent that if

* explicit timeout

Co-authored-by: andy-sweet <andy-sweet@users.noreply.github.com>

* Speed up notebook display tests  (napari#4641)

* test: speed up notebook test by not using viewer to check alt text

* style: pre-commit

* Remove sleep and wait with default timeout instead (napari#4638)

* Update installation instruction in documentation (napari#4639)

* update information about minimal python version

* add information about conda PySide2 install

* Update docs/tutorials/fundamentals/installation.md

Co-authored-by: Draga Doncila Pop <17995243+DragaDoncila@users.noreply.github.com>

* fix installation command

Co-authored-by: Draga Doncila Pop <17995243+DragaDoncila@users.noreply.github.com>

* test: Speed up test_viewer tests, split out pyqt5/pyside2 tests again (napari#4646)

* pull out alt-text parameters from viewer

* test: speed up notebook test by not using viewer to check alt text

* style: pre-commit

* magicgui tests work with xdist

* move magicgui test

* refactor keybindings test

* split tests

* fix mac

* fix tox params, and viewer test

* cancel previous  runs

* bump codecov

* explicit backends

* fix win 3.10

* mac to 3.9

* try pip

* fix extra name

* back to tox

* back to tox

* fix env factors

* undo some changes

* remove more whitespace

* add backend to minreq

* try pyside2 on mac

* back to pyqt5 on mac

* 3.10 for mac

* try xdist

* bump maxfail

* undo xdist change

* Add tests for qt_progress_bar.py (napari#4634)

* add tests for qt_progress_bar.py

* coverage _get_value

* More updates to the ignored translations file and translation CI infrastructure (napari#4596)

* rewrite JSON, sorting keys

* Update logic to not reorder strings.

* update json removing nonexisting strings

* fix a couple of pytest fixtures

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* build: slight updates/de-dups in setupcfg (napari#4645)

* build: slight updates/de-dups in setupcfg

* unpin lxml, remove semgrep

* Restore "show all key bindings" shortcut  (napari#4628)

* cleaning code

* provide consistency in shortcut representation

* add shortcut for shortcuts show

* fix test

* add test for action

* ci: fix tox factor names in tests (napari#4660)

* ci: fix tox factor names in tests

* ci: cancel previous runs

* Limit comprehensive test concurrency to 1. (napari#4655)

Just to make sure we don't block testing PRs with main

Mitigate napari#4653

* Do not run `asv` on push (napari#4656)

* do not run asv on test_comprehensive

* report failures as issue if non-PR

* test: speed up magicgui forward ref tests (napari#4662)

* test: speed up magicgui forward ref tests

* test: fix expected layer methods

* Allow to trigger test_translation manually (napari#4652)

* do not use keyword argument for QListWidgetItem (napari#4661)

* Enable patch coverage reporting (napari#4632)

* enable patch coverage

* set target to 0% to get only information

Co-authored-by: Talley Lambert <talley.lambert@gmail.com>

* Move test examples on end of test run them in different CI job  (napari#4647)

* move test examples on end

* allow test because of test order

* skip examples by marker

* exclude examples from test run

* fix tox after merge

* fix conf

* fix failing test

* proper test order on windows

* Apply suggestions from code review

Co-authored-by: Talley Lambert <talley.lambert@gmail.com>

Co-authored-by: Talley Lambert <talley.lambert@gmail.com>

* Fix docs for shape/points layer properties (napari#4659)

* fix names of future shape/points properties

* Also fix current_opacity to opacity

* shape opacity applies to all shapes

* Update docs/howtos/layers/points.md

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
Co-authored-by: Andy Sweet <andrew.d.sweet@gmail.com>

* feat: add codespace (napari#4599)

* feat: add codespace

* fix: fix check manifest

* Alternate fix for alt-text issues (napari#4617)

* Alternate fix for alt-text issues

* Re-escape alt-text

* Re-remove meshzoo

* Update explanatory comments

* add dependabot for github actions (napari#4671)

* ci(dependabot): bump peter-evans/create-pull-request from 3 to 4 (napari#4675)

Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 3 to 4.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](peter-evans/create-pull-request@v3...v4)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ci(dependabot): bump docker/build-push-action from 2.5.0 to 3 (napari#4676)

* ci(dependabot): bump docker/build-push-action from 2.5.0 to 3

Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2.5.0 to 3.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](docker/build-push-action@ad44023...e551b19)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update .github/workflows/docker-singularity-publish.yml

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Talley Lambert <talley.lambert@gmail.com>

* ci(dependabot): bump docker/metadata-action from 3 to 4 (napari#4679)

Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 3 to 4.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Upgrade guide](https://github.com/docker/metadata-action/blob/master/UPGRADE.md)
- [Commits](docker/metadata-action@v3...v4)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ci(dependabot): bump toshimaru/auto-author-assign from 1.3.4 to 1.5.0 (napari#4678)

Bumps [toshimaru/auto-author-assign](https://github.com/toshimaru/auto-author-assign) from 1.3.4 to 1.5.0.
- [Release notes](https://github.com/toshimaru/auto-author-assign/releases)
- [Changelog](https://github.com/toshimaru/auto-author-assign/blob/main/CHANGELOG.md)
- [Commits](toshimaru/auto-author-assign@v1.3.4...v1.5.0)

---
updated-dependencies:
- dependency-name: toshimaru/auto-author-assign
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Multi-color text with color encodings (napari#4464)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Optimization: convert point slice indices to floats (napari#4648)

* ci(dependabot): bump actions/setup-python from 3 to 4 (napari#4677)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 3 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add "Processors": (generalize magicgui return type behavior outside of magicgui) (napari#4543)

* formatting

* add setter

* add test

* extend test

* add test

* make clobber False by default

* wip

* wip, converting magicgui processors

* add add_layer

* Update napari/utils/_injection.py

Co-authored-by: Andy Sweet <andrew.d.sweet@gmail.com>

* Update napari/utils/_injection.py

Co-authored-by: Andy Sweet <andrew.d.sweet@gmail.com>

* Update napari/utils/_injection.py

Co-authored-by: Andy Sweet <andrew.d.sweet@gmail.com>

* Update napari/utils/_injection.py

Co-authored-by: Andy Sweet <andrew.d.sweet@gmail.com>

* adding tests

* start on worker

* single import

* fix typing

* fix test

* rearrange

* sort lines

* minor

* docs: update docstrings

* use zeros

* get rid of thread

* rename to providers/processors, add decorator

* update docstring

Co-authored-by: Andy Sweet <andrew.d.sweet@gmail.com>

* fix: fix manifest reader extensions, ensure that all builtins go through npe2 (napari#4668)

* fix: fix manifest reader extensions

* test: fix tests

* add warning

* add warning

* remove mistake file

* update another test

* fix another test

* revert napari#4575

* some more, but not all, fixed

* remove comment

* change napari builtins display name

* simplify get_potential_readers

* fix one more test

* skip some tests

* fix typecheck

* fix qt tests

* fix another qt test

* remove breakpoint

* remove napari hook implementation

* fix test_get_writer

* sort writer extensions

* remove initialize stuff

* fix cli show test

* bump svg

* allow use of validate_all=True on nested evented models (napari#4551)

* allow validate_all again

* rename to _protocols

* oops

* fix protocol more general

* use normal instance check

* reset source for all fields, not just mutable ones

* recursive source reset

* fix status of nap1 (napari#4685)

* [pre-commit.ci] pre-commit autoupdate (napari#4687)

updates:
- [github.com/asottile/pyupgrade: v2.32.1 → v2.34.0](asottile/pyupgrade@v2.32.1...v2.34.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Add new core devs to docs (napari#4691)

* Remove unused points _color state (napari#4666)

* Remove unused function and state

* Also remove unneeded addition

* Add function back

* Clean up PR

* Define different shortcuts for different screenshot actions in file menu (napari#4636)

* test: Cleanup usage of npe2 plugin manager in tests (napari#4669)

* fix: fix manifest reader extensions

* test: fix tests

* add warning

* add warning

* remove mistake file

* update another test

* fix another test

* revert napari#4575

* some more, but not all, fixed

* remove comment

* change napari builtins display name

* simplify get_potential_readers

* fix one more test

* skip some tests

* fix typecheck

* fix qt tests

* fix another qt test

* starting on new pm fixtures.  working sample hook

* update save layers and test reader plugins

* plugins module working

* remove tmp_reader

* more reduction

* finish viewer model

* update qt dialogs

* finish qt_extension2reader

* fix file menu

* add comments

* remove breakpoint

* fix layers

* fix components

* add builtins to examples test

* remove napari hook implementation

* fix test_get_writer

* sort writer extensions

* remove initialize stuff

* fix cli show test

* bump svg

* fix test

* use npe2 0.4.0

* more simplifications

* Update napari/conftest.py

Co-authored-by: Draga Doncila Pop <17995243+DragaDoncila@users.noreply.github.com>

* remove xfail

* add comment

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: Draga Doncila Pop <17995243+DragaDoncila@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Remove unnecessary uses of make_napari_viewer (replace with ViewerModel) (napari#4690)

* remove from experimental chunk

* two more in qt

* bunch more

* remove more

* add back one

* bump npe2, use new features (napari#4686)

* Remove `restore_settings_on_exit` test util (napari#4673)

* fix: fix manifest reader extensions

* test: fix tests

* add warning

* add warning

* remove mistake file

* update another test

* fix another test

* revert napari#4575

* some more, but not all, fixed

* remove comment

* change napari builtins display name

* simplify get_potential_readers

* fix one more test

* skip some tests

* fix typecheck

* fix qt tests

* fix another qt test

* starting on new pm fixtures.  working sample hook

* update save layers and test reader plugins

* plugins module working

* remove tmp_reader

* more reduction

* finish viewer model

* update qt dialogs

* finish qt_extension2reader

* fix file menu

* add comments

* remove breakpoint

* fix layers

* fix components

* add builtins to examples test

* remove restore_settings_on_exit

* add comment

* remove napari hook implementation

* fix test_get_writer

* sort writer extensions

* remove initialize stuff

* fix cli show test

* bump svg

* fix test

* remove unneeded line

* fix test

* Add modal dialogs for window/application closure (napari#4637)

Co-authored-by: alisterburt <alisterburt@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Juan Nunez-Iglesias <jni@fastmail.com>

* Design issue template assignees (napari#4701)

Issue template for design-related issues now should auto-assign any created issues to Lisa and Isabela (formerly it assigned to Lia)

* Keep order of layers when select to save multiple selected layers (napari#4689)

* honor confirm close settings when quitting (napari#4700)

* honor confirm close settings on quit

* update string

* Update napari/settings/_application.py

Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>

* Update napari/settings/_application.py

Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>

Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>

* Add option to use npe2 shim/adaptor for npe1 plugins (napari#4564)

* add opt-in npe2 shim

* add comment

* show shims in plugin installer

* don't use mock

* fix: fix manifest reader extensions

* test: fix tests

* add warning

* add warning

* remove mistake file

* update another test

* fix another test

* revert napari#4575

* some more, but not all, fixed

* remove comment

* change napari builtins display name

* simplify get_potential_readers

* fix one more test

* skip some tests

* fix typecheck

* fix qt tests

* fix another qt test

* remove breakpoint

* remove napari hook implementation

* fix test_get_writer

* update docs

* add trans

* add requires restart

* use requires_restart

* Use python 3.9 for mac tests until numcodecs 3.10 wheels are available (napari#4707)

* Apply shown mask to points._view_size_scale (napari#4699)

* Apply shown mask to points._view_size_scale

* Added two tests for points related to the view_size and shown

* Add test case for view_size if no point is shown

* Update test to check for the actual dimension as well

* Put a comment explaining the 3 if statements

* Merge two tests into one for view_size

Co-authored-by: Markus Stabrin <markus.stabrin@gmail.com>

* remove print (napari#4718)

* Use `cache: pip` from actions setup-python (napari#4672)

* try pip cache

* more cache

* tox vv

* use cache in comprehensive too

* remove verbose

* use same coverage report like in pull requests (napari#4722)

* fix presentation and enablement of npe1 plugins (napari#4721)

* Improvements on scale bar (napari#4511)

* Background box under scale bar to improve legibility

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Now possible to change the color of scale bar and surrounding box

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* updated test and clean up for box visibility

* scale bar color now managing all allowed color formats. Tests updated

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removed unused import of Union

* Simplify logic and add docs

* Make colors non-optional

* Fix initial box color

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
Co-authored-by: Andy Sweet <andrew.d.sweet@gmail.com>

* napari.viewer.current_viewer fallback ancestor (napari#4715)

* napari.viewer.current_viewer fallback ancestor

The use case is modal dialogs from magicgui.request_values, who have no parent. If they wish to use a layer, they must get that layer from the current viewer.

* Fix test_magicgui_get_viewer

This was broken as it now returns current_viewer where it did not
before. Now, we ensure that a parent-less widget returns current_viewer,
  and a child widget returns its parent viewer

* Test current_viewer behavior

At the request of @ctrueden

* Add NAP-3: Spaces (napari#4684)

* nap 3

* finish up first draft of nap3

* address comments and fix grammar

* incorporate some comments

* Color edit without tooltip fix (napari#4717)

* Fix typo in QColorSwatchEdit

* Add a new test for QColorSwatch

* Use some features from npe2 v0.5.0 (napari#4719)

* bump version

* use npe2pm

* Update translation documentation link in pull request template (napari#4728)

* Refactor label painting by moving code from mouse bindings onto layer, adding staged history and paint event (napari#4702)

* Fix bug in deepcopy of utils.context.Expr (napari#4730)

* add tests for deepcopy of Expr

* fix repr test on 3.8

* fix test again

* Update napari/utils/context/_expressions.py

* try to fix typing

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>

* Tracks tail update fix beyond _max_length (napari#4688)

* Auto-update _max_length upon setting tail_length

* Remove tail_length clipping by _max_length upon update

* Move track display limits to constructor

* - Auto-update _max_length upon setting head_length
- Remove head_length clipping by _max_length upon update

* Add test cases for length change

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* split Image `interpolation` on two properties, `interpoltion2d` and `interpolation3d`  (napari#4725)

* add name migration mechanism

* split interpolation on 2 properties

fix tests

* make interpolation event deprecated

* add remove version to `rename_argument` decorator

* verify if only one name of argument is used

* change to deprecation warnings

* make interpolation getter deprecated

* move intepolation event to new setters

* add type annotation for better refactor support

* fix test

* fix tox file

* fix tox 2

* fix tox 3

* Fix Image parameter docs (napari#4750)

* Fix `_get_state` for empty Vectors and Points layers (napari#4748)

* Add a public API for the setGeometry method of _qt_window (napari#4729)

Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Do not inform about coverage untill all CI jobs are done (napari#4751)

* do not inform about coverage untill all jobs are done

* fix codecov.yaml

* reduce number

* Allow pandas.Series as properties values (napari#4755)

* Allow pandas.Series as properties values

* Add numpy array to the tests and mixed cases

* Add series property tests to points layer

* Adjust according to reviews

* Remove debug prints

* ci(dependabot): bump docker/login-action from 1.9.0 to 2 (napari#4774)

Bumps [docker/login-action](https://github.com/docker/login-action) from 1.9.0 to 2.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](docker/login-action@28218f9...49ed152)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ci(dependabot): bump bruceadams/get-release from 1.2.2 to 1.2.3 (napari#4773)

Bumps [bruceadams/get-release](https://github.com/bruceadams/get-release) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/bruceadams/get-release/releases)
- [Commits](bruceadams/get-release@v1.2.2...v1.2.3)

---
updated-dependencies:
- dependency-name: bruceadams/get-release
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ci(dependabot): bump actions/github-script from 5 to 6 (napari#4772)

Bumps [actions/github-script](https://github.com/actions/github-script) from 5 to 6.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](actions/github-script@v5...v6)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ci(dependabot): bump actions/download-artifact from 2 to 3 (napari#4771)

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v2...v3)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ci(dependabot): bump styfle/cancel-workflow-action from 0.9.1 to 0.10.0 (napari#4770)

Bumps [styfle/cancel-workflow-action](https://github.com/styfle/cancel-workflow-action) from 0.9.1 to 0.10.0.
- [Release notes](https://github.com/styfle/cancel-workflow-action/releases)
- [Commits](styfle/cancel-workflow-action@0.9.1...0.10.0)

---
updated-dependencies:
- dependency-name: styfle/cancel-workflow-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Make references to examples link there (napari#4767)

* docs/index: fix references to main branch

* Make references to examples folder link there

* fix clim init for dask arrays (napari#4724)

* fix clim init for dask arrays

* fix tensorstore

* avid double-calculation

* add test for clim

* move test to dask and make sync only

* use normalize_dtype

* Set focus on `QtViewer` object after creating main window (napari#4768)

* Add missed call of `running_as_bundled_app` in `__main__` (napari#4777)

* Add public API for dims transpose (napari#4727)

* Update dims.py

Add public API for dims transpose

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Remove _transpose usage, deprecate it and fix typos

* Fix typo

* Update napari/components/dims.py

Co-authored-by: Kevin Yamauchi <kevin.yamauchi@gmail.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update dims.py

Remove old _transpose private method

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
Co-authored-by: Kevin Yamauchi <kevin.yamauchi@gmail.com>

* Use `npe2 list` to show plugin info (napari#4739)

* use npe2 list for plugin info

* bump npe2

* fix test

* fix test

* Fix source of copied layer events by use `layer.as_layer_data_tuple` (napari#4681)

* Fixing readme typo (napari#4791)

* readd ensure_unique

Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com>
Co-authored-by: Lucy Liu <jliu176@gmail.com>
Co-authored-by: Jaime Rodríguez-Guerra <jaimergp@users.noreply.github.com>
Co-authored-by: andy-sweet <andy-sweet@users.noreply.github.com>
Co-authored-by: Talley Lambert <talley.lambert@gmail.com>
Co-authored-by: Andy Sweet <andrew.d.sweet@gmail.com>
Co-authored-by: Draga Doncila Pop <17995243+DragaDoncila@users.noreply.github.com>
Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Guillaume Witz <guiwitz@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: alisterburt <alisterburt@gmail.com>
Co-authored-by: Juan Nunez-Iglesias <jni@fastmail.com>
Co-authored-by: Lia Prins <53277128+liaprins-czi@users.noreply.github.com>
Co-authored-by: Markus Stabrin <markus.stabrin@mpi-dortmund.mpg.de>
Co-authored-by: Markus Stabrin <markus.stabrin@gmail.com>
Co-authored-by: Pierre Thibault <pierrethibault@users.noreply.github.com>
Co-authored-by: Gabriel Selzer <gjselzer@wisc.edu>
Co-authored-by: cnstt <104427648+cnstt@users.noreply.github.com>
Co-authored-by: Kushaan Gupta <gkushaan@rediffmail.com>
Co-authored-by: David Stansby <dstansby@gmail.com>
Co-authored-by: Curtis Rueden <ctrueden@wisc.edu>
Co-authored-by: Kevin Yamauchi <kevin.yamauchi@gmail.com>
Co-authored-by: Jordão Bragantini <jordao.bragantini@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation preferences Issues relating to the creation of new preference fields/panels qt Relates to qt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants