Commit 3f27058
authored
Add
This pull request introduces the new `BatchRunner` class to the `nbatch` package, providing a higher-level API for orchestrating batch operations with support for threading, progress callbacks, and cancellation. The documentation and package metadata have been updated to reflect this addition, and new optional dependencies and usage examples are included for better integration with napari and Qt-based workflows.
**Major new feature: BatchRunner integration**
- Introduced the `BatchRunner` class for orchestrating batch operations, including threading, progress/cancellation callbacks, and seamless napari integration. The API is now documented in both `README.md` and `src/nbatch/__init__.py`, and the class is exported in the package's public interface. [[1]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R20-R24) [[2]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L184-R246) [[3]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R332-R365) [[4]](diffhunk://#diff-b47af7882e75362ef6c3f4f6ee9347b3b112d3e049324f680ad320f40c74ed58R17-R19) [[5]](diffhunk://#diff-b47af7882e75362ef6c3f4f6ee9347b3b112d3e049324f680ad320f40c74ed58L43-R57) [[6]](diffhunk://#diff-b47af7882e75362ef6c3f4f6ee9347b3b112d3e049324f680ad320f40c74ed58R69) [[7]](diffhunk://#diff-b47af7882e75362ef6c3f4f6ee9347b3b112d3e049324f680ad320f40c74ed58R82-R83)
**Documentation and usage improvements**
- Expanded the `README.md` with recommended usage patterns for `BatchRunner`, including widget integration examples, and clarified how to use napari's `@thread_worker` directly for advanced users. [[1]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L184-R246) [[2]](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R332-R365)
- Updated the top-level docstring in `src/nbatch/__init__.py` with new examples and a description of `BatchRunner`. [[1]](diffhunk://#diff-b47af7882e75362ef6c3f4f6ee9347b3b112d3e049324f680ad320f40c74ed58R17-R19) [[2]](diffhunk://#diff-b47af7882e75362ef6c3f4f6ee9347b3b112d3e049324f680ad320f40c74ed58L43-R57)
**Dependency and packaging enhancements**
- Added optional dependencies for napari and Qt (`napari`, `pyqt6`) and grouped them under `[project.optional-dependencies]` in `pyproject.toml`, with an `all` group for convenience. Development dependencies now include these extras for full test coverage.
- Added the `Framework :: napari` classifier to better indicate napari integration.
**Minor code and typing cleanups**
- Updated type checks in `_decorator.py` and `_discovery.py` to use the `list | tuple` syntax. [[1]](diffhunk://#diff-b8b54f8f8e15eb73a90baac496cccec0e224de523851c1953a65d884abd4679dL175-R177) [[2]](diffhunk://#diff-f7448bdb0f8849649110e4176d1907acb18430dd31ea6fb0b695031a24b28cf1L190-R190)
- Clarified that the core package has no napari/Qt dependencies, only using them optionally.BatchRunner for orchestrated batch operations (#2)File tree
7 files changed
+1201
-6
lines changed- src/nbatch
- tests
7 files changed
+1201
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
181 | 183 | | |
182 | 184 | | |
183 | 185 | | |
184 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
185 | 247 | | |
186 | 248 | | |
187 | 249 | | |
| |||
267 | 329 | | |
268 | 330 | | |
269 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
270 | 366 | | |
271 | 367 | | |
272 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
34 | 47 | | |
35 | 48 | | |
36 | 49 | | |
37 | 50 | | |
38 | 51 | | |
| 52 | + | |
| 53 | + | |
39 | 54 | | |
40 | 55 | | |
41 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | | - | |
| 46 | + | |
44 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
45 | 58 | | |
46 | 59 | | |
47 | 60 | | |
| |||
53 | 66 | | |
54 | 67 | | |
55 | 68 | | |
| 69 | + | |
56 | 70 | | |
57 | 71 | | |
58 | 72 | | |
| |||
65 | 79 | | |
66 | 80 | | |
67 | 81 | | |
| 82 | + | |
| 83 | + | |
68 | 84 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
191 | 191 | | |
192 | 192 | | |
0 commit comments