feat: add URL IO utility widget - #151
Conversation
for more information, see https://pre-commit.ci
…r/napari-ome-zarr into add-URL-utility-widget
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Pull request overview
Adds a napari “IO utility” widget that lets users paste a remote OME-Zarr URL in the UI and import it via the existing reader pipeline, and wires the widget into the napari manifest/plugin entry-point configuration.
Changes:
- Define a
napari.manifestentry point inpyproject.tomland extend the manifest to register a new command/widget + File menu item. - Add a new
import_from_urlmagicgui-based widget that calls the existing reader and adds returned layers to the current viewer. - Update isort configuration to recognize
magicguias a third-party import.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
pyproject.toml |
Switches to explicit napari.manifest entry point for plugin discovery. |
napari_ome_zarr/napari.yaml |
Registers the new URL importer command, menu entry, and widget in the napari manifest. |
napari_ome_zarr/_widgets.py |
Implements the URL import widget and layer-adding behavior. |
.isort.cfg |
Adds magicgui to known third-party modules for import sorting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
will-moore
left a comment
There was a problem hiding this comment.
This works fine and is a nice addition to the plugin.
Code looks good.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #151 +/- ##
==========================================
- Coverage 86.82% 83.80% -3.02%
==========================================
Files 5 5
Lines 516 531 +15
==========================================
- Hits 448 445 -3
- Misses 68 86 +18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
FYI this already should work with just File > New from clipboard if the link is on your clipboard! |
|
@psobolewskiPhD cool feature! Do you know by any chance since when this is in napari? Currently napari-ome-zarr pins |
|
Looks like 0.5.0 (which also made async work, which is pretty crucial to this plugin IMO): Anyhow, I don't intend to dissuade this widget, just pointing an existing feature. Ideally we'd have a proper dialog in napari so every plugin could use it instead of rolling their own! |
|
Yeah...0.5 is probably a reasonable pin by now :) Also now worries about dissuading, I'm always happy to discover new functionality. In that case I'd just replace this PR by a note in the docs on how to open URLs from the UI. |
|
A tip about New Image from Clipboard is on the welcome screen of napari (the canvas when no layers are present), but I guess folks can quickly gloss over that.
Or a PR to napari to implement the dialog 😉 |
@will-moore just a small feature directly following in the wake of #123: This PR adds a small IO utility to open ome-zarrs from remote URLs directly from the napari UI:
Paste the URL, hit Import and the rest is doing the same as the reader code. The widget ids available under
File > IO utilities > Import OME-ZARR from URL