Pre-docs cleanup: fix the typo'd names and tighten the lint gate - #443
Pre-docs cleanup: fix the typo'd names and tighten the lint gate#443kozlov721 wants to merge 19 commits into
Conversation
The check runs with the same pin as luxonis-ml and modelconverter. The configuration allows `TOOD` (a paper acronym), `ScatterND` (an ONNX operator), and skips `*.drawio` files, because `typos` mangles their opaque element ids. Most fixes change docstrings, comments, and messages. The rest rename local variables (`padd`, `als`, `overlaps_thr_per_gt`), the `check_n_workes_platform` validator, and the free-form model name in `anomaly_detection_model.yaml`. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXj7GZFCcdShtaTweRNH9j
The rename covers the `Reparameterizable` base class, its module file, `GeneralReparameterizableBlock`, the `reparameterize` methods, and the related docstrings. Class and method names do not reach the state dicts, so saved checkpoints still load. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXj7GZFCcdShtaTweRNH9j
The class name does not reach the state dicts, so saved checkpoints still load. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXj7GZFCcdShtaTweRNH9j
The name is a wiring key: the head emits it in its output packet and the loss receives it as a parameter of `forward`. The commit renames the key, the parameter, and the tests together, so the wiring holds. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXj7GZFCcdShtaTweRNH9j
The attribute is a registered submodule, so the state-dict keys change. Old PPLCNetV3 checkpoints do not load any more. The node has no remote weights URL, so only local checkpoints are affected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXj7GZFCcdShtaTweRNH9j
The configuration follows the modelconverter cleanup: the `ASYNC`, `EXE`, `G`, `PGH`, `SLOT` groups, the full `PERF` group, formatted docstring code examples, and a ban on `__future__` imports. The two `__future__` users switch to string annotations. `PGH003` and `PLR0917` go to the ignore list; the blanket type-ignores leave with the type-gate follow-up. The code fixes cover the new findings: two manual list builds turn into `extend` calls, three unions move `None` to the end, the duplicated `__all__` entries in `nodes/blocks` go away, one blanket `noqa` gets its rule code, and the duplicated parameter formatting in `LuxonisModelSummary` moves into a helper. The ruff hook moves to v0.16.1 to match the `~=0.16` dev pin. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXj7GZFCcdShtaTweRNH9j
The gitignored `build` directory holds an old copy of the package that setuptools leaves behind. Pyright read it and reported bogus "X is not assignable to X" errors against the stale copy. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXj7GZFCcdShtaTweRNH9j
Pydoctor reported 49 "documented parameter does not exist" warnings. Each doc entry now names the parameter that the signature has, or goes away when the parameter no longer exists. The `recsubnet` docstring also cited the DeiT paper title with the DRAEM link; the title now matches the link. The remaining pydoctor warnings are format-level: the `@license` and `@copyright` fields, the missing link targets, and one `*args` annotation the parser cannot read. The Google docstyle migration rewrites those docstrings. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXj7GZFCcdShtaTweRNH9j
The custom-nodes link pointed at the dead `models/nodes/` path. The custom-callback config example passed `lr` to a callback whose parameter is `message`. The GCS protocol example spelled the bucket as "buclet". The table of contents linked to a "key-features" anchor that did not exist. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXj7GZFCcdShtaTweRNH9j
`actions/labeler` reads `head-branch` patterns as unanchored regular expressions, so `"release/*"` matched any branch name that contains "release". PR #437 (branch `ci/release-automation`) got the `release` label and disappeared from the generated release notes, because `.github/release.yaml` excludes that label. Every prefix pattern now anchors with `^`. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXj7GZFCcdShtaTweRNH9j
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe pull request standardizes spelling, naming, documentation, lint tooling, branch-label patterns, and test coverage. It also centralizes parameter-count formatting and renames the reparameterization API. ChangesRepository consistency and naming cleanup
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: 🔵 Low · up to The update modernizes tuning APIs and adds coverage, but the new tests still exercise dependency APIs with a documented removal path. This is a bounded compatibility concern requiring owner awareness before merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #443 +/- ##
==========================================
+ Coverage 94.61% 94.79% +0.18%
==========================================
Files 290 291 +1
Lines 15868 15941 +73
==========================================
+ Hits 15013 15112 +99
+ Misses 855 829 -26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
The hook stayed at v3.8.3 while the other hooks moved forward. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C9WMoUvjBxLnqYrGJdNZrg
The examples used single quotes, loose spacing around the class definitions, and lines above the limit. They now match the style that ruff applies to the source. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C9WMoUvjBxLnqYrGJdNZrg
The warning said "wit ha single key". The `typos` hook does not find the fault, because both words are correct. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C9WMoUvjBxLnqYrGJdNZrg
The three helpers had no unit tests. The bounding-box tests cover the threshold guards, the single-class objectness copy, the class filter, the box-format conversion, and the unknown reduction type. The tuner tests cover the parameter parsing and its eight error paths. Two tests pin the pass-through of `decode_text_metadata_labels` for a string array and for a non-text type. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C9WMoUvjBxLnqYrGJdNZrg
A node without variants calls `get_variants`, which raises `NotImplementedError`. The metaclass caught it and then called `__init__` inside the handler. Such a node often builds itself from a remote checkpoint, so a network failure in `__init__` chained onto the `NotImplementedError`. The traceback then opened with a variants error, and the real cause sat below a "During handling of the above exception" line. A CI run showed this: a gateway timeout from the torch hub surfaced as `NotImplementedError` followed by `KeyError: 'Authorization'`. The fallback now runs after the handler, so `__init__` raises on its own. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C9WMoUvjBxLnqYrGJdNZrg
`get_trial_params` called `suggest_loguniform` and `suggest_uniform`. Optuna deprecated both in v3.0.0 and removes them in v6.0.0. The project pins `optuna~=4.6`, so both calls raise a `FutureWarning` today. The `_loguniform` and `_uniform` config suffixes stay the same. No user config needs a change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013w7gCMnb22CH2DoAFqCePo
`non_max_suppression` built a boolean mask over the boxes above the
threshold, then concatenated it with the per-pair class indices. A box
above the threshold on two classes gave one masked row but two class
indices, so `torch.cat` raised:
RuntimeError: Sizes of tensors must match except in dimension 1.
Expected size 1 but got size 2 for tensor number 1 in the list.
That is the only case `multi_label=True` exists for, so the flag failed
on every real input.
An index tensor now replaces the mask. It repeats a box once for each of
its classes. The `has_additional` branch uses the same index, so the
trailing columns repeat with the box.
No caller in the project passes `multi_label=True`. The single-label
branch keeps the same rows in the same order, so its output does not
change.
The old test asserted a result that `multi_label=False` also gives, and
its comment named a function that does not exist. Two tests replace it.
The first asserts three detections from two boxes. The second covers the
trailing columns.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013w7gCMnb22CH2DoAFqCePo
Purpose
Prepare the repository for the Google docstyle migration and clean it
up in general. The PR mirrors the pre-docs cleanup in
modelconverter(luxonis/modelconverter#276) and the "Small breaking changes" PR in
luxonis-ml(luxonis/luxonis-ml#426). The docstyle migration followsin a separate PR; it converts the docstrings that this PR makes
correct.
Specification
typospre-commit check with the same pin as the siblingrepositories, and fix the 75+ typos it found.
reparametrize→reparameterize(base class, module file,GeneralReparameterizableBlock, methods).AttentionRefinmentBlock→AttentionRefinementBlock.mask_coeficients→mask_coefficients(head output key, lossparameter, tests — renamed together, so the wiring holds).
detecion_blocks→detection_blocks.ASYNC,EXE,G,PGH,SLOT, fullPERF, formatted docstringcode examples, and a ban on
__future__imports. Fix the newfindings and bump the ruff hook to match the
~=0.16dev pin.builddirectory from pyright.head-branchregexes in.github/labeler.yaml, so abranch such as
ci/release-automationno longer gets thereleaselabel and no longer disappears from the release notes.
prettierhook from v3.8.3 to v3.9.6.README.mdandexamples/README.md.typoshookdoes not find it, because both words are correct.
__init__inside itsexcept NotImplementedErrorhandler. A node without variants oftenbuilds itself from a remote checkpoint. A network failure there
chained onto the
NotImplementedError, so the traceback opened witha variants error and hid the real cause.
parsing, and the metadata decode pass-through.
Out of scope, with their own follow-ups:
@licensefields,link targets). The docstyle migration rewrites those docstrings.
Any,cast, blanket type-ignores;PGH003sitsin the ignore list for now), like
chore/type-gate-and-coverageinmodelconverter.
Dependencies & Potential Impact
detecion_blocksattribute of PPLCNetV3 is aregistered submodule, so its state-dict keys change. Old PPLCNetV3
checkpoints do not load any more. The node has no remote weights
URL, so only local checkpoints are affected.
renamed methods must update the names. Configs are not affected; no
registry name changes.
Deployment Plan
None / not applicable — the changes ship with the next release.
Testing & Validation
prek run --all-files: all hooks pass, including the newtyposhook.
pydoctor --docformat=epytext: the 49 content warnings go to 0.pyright --warnings: at exact parity withmain(2 pre-existingaimet_torchimport errors from the optional extra).pytest -m unit: 547 passed. The 9 failures are the known expiredgcloud-ADC failures in
tests/unittests/test_losses, not codefailures.
AI Usage
Assisted-by: Claude:claude-fable-5
Submitted code was reviewed by a human: NO
The author is taking the responsibility for the contribution: YES
🤖 Generated with Claude Code
https://claude.ai/code/session_01KXj7GZFCcdShtaTweRNH9j
Summary by CodeRabbit
Documentation
Refactor
Tests
Chores