huge diff: refactor to include utilities container and more settings#35
huge diff: refactor to include utilities container and more settings#35TimMonko merged 11 commits intondev-kit:mainfrom
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR refactors the ndevio package to include a comprehensive utilities widget container and introduces new export settings. The main changes involve renaming settings keys from PascalCase to snake_case (ndevio_Reader → ndevio_reader), adding a new UtilitiesContainer widget for image I/O operations in napari, implementing lazy imports for performance, and introducing helper functions for common image processing tasks.
- Renamed settings key
ndevio_Readertondevio_readerfor consistency - Added new
UtilitiesContainerwidget providing batch concatenation, scene extraction, layer export, and canvas screenshot functionality - Introduced
helpers.pymodule with utility functions for file handling, channel names, and string manipulation
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_nimage.py | Updated test assertions to use new snake_case settings key ndevio_reader |
| tests/test_helpers.py | Added comprehensive test coverage for new helper functions |
| src/ndevio/widgets/_utilities_container.py | New widget providing I/O utilities including batch operations, scene extraction, and export functionality |
| src/ndevio/widgets/_scene_widget.py | Updated to use new snake_case settings key ndevio_reader |
| src/ndevio/widgets/init.py | Added UtilitiesContainer to exports |
| src/ndevio/nimage.py | Updated settings references and moved imports for lazy loading optimization |
| src/ndevio/ndev_settings.yaml | Renamed settings section to snake_case and added new ndevio_export settings |
| src/ndevio/napari.yaml | Registered new UtilitiesContainer widget |
| src/ndevio/helpers.py | New module with helper functions for file operations and image metadata |
| src/ndevio/_napari_reader.py | Updated to use new snake_case settings key |
| src/ndevio/init.py | Implemented lazy imports using getattr for performance optimization |
| pyproject.toml | Added new dependencies: napari, nbatch, natsort, magicgui, magic-class |
| AGENTS.md | Updated documentation to reflect new settings naming convention |
| .pre-commit-config.yaml | Excluded ndev_settings.yaml from YAML checks and updated ndev-settings hook version |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
xref: ndev-kit/napari-ndev#210
Copilot explanation
This pull request introduces several improvements and updates across the codebase, focusing on standardizing configuration naming, expanding settings for export functionality, enhancing dependency management, and adding new utility functions. The changes also improve documentation and developer experience.
Configuration and Settings Standardization
Renamed all references of
ndevio_Readertondevio_readerin settings, code, and documentation for consistency and clarity. This affects YAML files, code logic, and markdown documentation. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Added new export-related settings under
ndevio_exporttondev_settings.yaml, enabling control over canvas scaling, size, and override behavior for exported figures and screenshots.Dependency and Environment Updates
Updated dependencies in
pyproject.toml: pinnedndev-settingsto version>=0.4.0, added new packages (napari,nbatch,natsort,magicgui,magic-class), and includedbioio-czifor development/testing. Also set a minimum coverage threshold for tests. [1] [2] [3]Modified
.pre-commit-config.yamlto excludesrc/ndevio/ndev_settings.yamlfrom YAML syntax checks and updated thendev-settingshook to use version0.4.0. [1] [2]Utilities and API Enhancements
Added a new
helpers.pymodule with utility functions for file handling and image processing, such as directory scanning, channel name extraction, dimension order calculation, ID string creation, missing file checking, and string elision.Updated
__init__.pyto support lazy loading ofnImageand expose the newhelpersmodule in the public API.Documentation and Developer Experience
AGENTS.mdto reflect configuration changes and updated installation instructions to use the correctuv pipcommand for development dependencies. [1] [2] [3] [4] [5]Plugin and Widget Contributions
napari.yamlfor easier access to file and export utilities from the napari interface. [1] [2]These changes collectively improve maintainability, usability, and extensibility of the codebase while introducing new features and ensuring consistency across settings and documentation.