Commit 6b347af
authored
huge diff: refactor to include utilities container and more settings (#35)
xref: ndev-kit/napari-ndev#210
1. Rip out Utilities Container from napari-ndev
2. Move helpers from napari-ndev to here <- this needs refactored out
completely later
3. Update settings
4. update some pyproject config / pre-commit to fix things
5. lazy imports to improve import time (2.5s to 15ms, but nImage still
pulls in BioImage which is ~2s)
6. fix and add tests, but nothing is "broken" re: legacy code
## 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_Reader` to `ndevio_reader` in
settings, code, and documentation for consistency and clarity. This
affects YAML files, code logic, and markdown documentation.
[[1]](diffhunk://#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9L98-R98)
[[2]](diffhunk://#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9L285-R285)
[[3]](diffhunk://#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9L311-R311)
[[4]](diffhunk://#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9L565-R565)
[[5]](diffhunk://#diff-a1495b29f6e07c8278a427f1ad3f4b1033da9353d263c050f0c8d9ac1b2aeebdL54-R60)
[[6]](diffhunk://#diff-a1495b29f6e07c8278a427f1ad3f4b1033da9353d263c050f0c8d9ac1b2aeebdL81-R81)
[[7]](diffhunk://#diff-11c9170a9cc22a07c8e3347c1210ae7bfb99877cba412ab3d5d79f7c691c9f09L1-R1)
[[8]](diffhunk://#diff-11c9170a9cc22a07c8e3347c1210ae7bfb99877cba412ab3d5d79f7c691c9f09R29-R48)
[[9]](diffhunk://#diff-e483cf7e2129edce2bdf6c16f9e6bb60e0716ee89b8d788206109cdd6d782c3fL37-R35)
[[10]](diffhunk://#diff-e483cf7e2129edce2bdf6c16f9e6bb60e0716ee89b8d788206109cdd6d782c3fL62-R61)
[[11]](diffhunk://#diff-e483cf7e2129edce2bdf6c16f9e6bb60e0716ee89b8d788206109cdd6d782c3fL71-R70)
[[12]](diffhunk://#diff-e483cf7e2129edce2bdf6c16f9e6bb60e0716ee89b8d788206109cdd6d782c3fL277-R278)
* Added new export-related settings under `ndevio_export` to
`ndev_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`: pinned `ndev-settings` to
version `>=0.4.0`, added new packages (`napari`, `nbatch`, `natsort`,
`magicgui`, `magic-class`), and included `bioio-czi` for
development/testing. Also set a minimum coverage threshold for tests.
[[1]](diffhunk://#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711L31-R44)
[[2]](diffhunk://#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R60)
[[3]](diffhunk://#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R91-R93)
* Modified `.pre-commit-config.yaml` to exclude
`src/ndevio/ndev_settings.yaml` from YAML syntax checks and updated the
`ndev-settings` hook to use version `0.4.0`.
[[1]](diffhunk://#diff-63a9c44a44acf85fea213a857769990937107cf072831e1a26808cfde9d096b9R10-R11)
[[2]](diffhunk://#diff-63a9c44a44acf85fea213a857769990937107cf072831e1a26808cfde9d096b9L23-R25)
### Utilities and API Enhancements
* Added a new `helpers.py` module 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__.py` to support lazy loading of `nImage` and expose
the new `helpers` module in the public API.
### Documentation and Developer Experience
* Improved documentation in `AGENTS.md` to reflect configuration changes
and updated installation instructions to use the correct `uv pip`
command for development dependencies.
[[1]](diffhunk://#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9L22-R22)
[[2]](diffhunk://#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9L98-R98)
[[3]](diffhunk://#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9L285-R285)
[[4]](diffhunk://#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9L311-R311)
[[5]](diffhunk://#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9L565-R565)
### Plugin and Widget Contributions
* Added a new "I/O Utilities" widget to `napari.yaml` for easier access
to file and export utilities from the napari interface.
[[1]](diffhunk://#diff-37781c656dd096700e29a43b6a5fb914d4e9f1632516709c538774e9fb0e5149R21-R23)
[[2]](diffhunk://#diff-37781c656dd096700e29a43b6a5fb914d4e9f1632516709c538774e9fb0e5149R72-R73)
---
These changes collectively improve maintainability, usability, and
extensibility of the codebase while introducing new features and
ensuring consistency across settings and documentation.1 parent 29379b4 commit 6b347af
File tree
27 files changed
+4728
-2430
lines changed- src/ndevio
- widgets
- tests
- resources
- test_czis
27 files changed
+4728
-2430
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | | - | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
| 285 | + | |
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
| 311 | + | |
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| |||
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
565 | | - | |
| 565 | + | |
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
39 | | - | |
| 44 | + | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| |||
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
| 60 | + | |
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
| |||
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
85 | 94 | | |
86 | 95 | | |
87 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
6 | | - | |
7 | | - | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
9 | 23 | | |
10 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
0 commit comments