Commit 43736ad
Bugfix/fix ruff errors (#12)
* Fix ruff I001: sort imports in _base_classes.py
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Fix ruff F401: declare OxfordFlowerDataset re-export via __all__
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Fix ruff B027: remove empty __init__ from FeatureExtractorBase
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Fix ruff B028: add stacklevel=2 to warnings.warn calls
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Fix ruff B904: chain exceptions with 'raise ... from e' in except clauses
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Fix ruff B008: replace function-call defaults with None and lazy init
RootSIFT() and vgg16(weights=...) were evaluated once at import time; vgg16 in particular triggered a model download on import. They are now instantiated per-call inside __init__ when the argument is omitted.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Fix ruff B905: pass strict=True to zip() calls
All zipped sequences are required to have equal lengths, so strict=True turns silent truncation on a length mismatch into an immediate ValueError.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Fix ruff F403/F405: replace star imports in example notebooks
Replaces 'from pyvisim._utils import *' with explicit imports in the five example notebooks. This required restoring plot_image, cluster_and_return_labels, cluster_images_and_generate_statistics, plot_and_save_heatmap and plot_and_save_barplot to pyvisim/_utils.py: they were deleted as dead code in b2832a7, but the notebooks still call them (the dead-code scan did not cover notebooks). Restored versions are modernized to pass the current lint config, and the bogus check_is_image decorator was not restored.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* added ruff-check in pre commit
* Potential fix for pull request finding
fixed indentation in pre commit config file
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Potential fix for pull request finding
in plot_image, detach if it's a torch tensor
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Potential fix for pull request finding
in plot_and_save_heatmap, turn everything to numpy before plotting
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* ran ruff formatter again
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>1 parent 0855bfe commit 43736ad
16 files changed
Lines changed: 279 additions & 107 deletions
File tree
- examples
- pyvisim
- datasets
- encoders
- features
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 31 | + | |
| 32 | + | |
49 | 33 | | |
50 | 34 | | |
51 | 35 | | |
| |||
316 | 300 | | |
317 | 301 | | |
318 | 302 | | |
319 | | - | |
| 303 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 34 | + | |
48 | 35 | | |
49 | 36 | | |
50 | 37 | | |
| |||
320 | 307 | | |
321 | 308 | | |
322 | 309 | | |
323 | | - | |
| 310 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 32 | + | |
40 | 33 | | |
41 | 34 | | |
42 | 35 | | |
| |||
305 | 298 | | |
306 | 299 | | |
307 | 300 | | |
308 | | - | |
| 301 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
| |||
170 | 174 | | |
171 | 175 | | |
172 | 176 | | |
173 | | - | |
| 177 | + | |
174 | 178 | | |
175 | 179 | | |
176 | 180 | | |
| |||
180 | 184 | | |
181 | 185 | | |
182 | 186 | | |
183 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
184 | 190 | | |
185 | 191 | | |
186 | 192 | | |
187 | | - | |
| 193 | + | |
188 | 194 | | |
189 | 195 | | |
190 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 35 | + | |
49 | 36 | | |
50 | 37 | | |
51 | 38 | | |
| |||
553 | 540 | | |
554 | 541 | | |
555 | 542 | | |
556 | | - | |
| 543 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 46 | + | |
59 | 47 | | |
60 | 48 | | |
61 | 49 | | |
| |||
1093 | 1081 | | |
1094 | 1082 | | |
1095 | 1083 | | |
1096 | | - | |
| 1084 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | 41 | | |
46 | 42 | | |
47 | 43 | | |
| |||
0 commit comments