Skip to content

Commit 8b33f42

Browse files
author
xXIlRizzoXx
committed
fix(ruff): noqa PLR0913 on ultralytics_predict (legit 6 args)
The upstream signature already had 5 args (the PLR0913 ceiling). The class-filter feature adds exclude_classes as a separate string param to keep the UI wiring (one checkbox + one textbox) symmetric with the include filter. Bundling both into a tuple/dict would either break existing kwarg call sites or hide intent at the call site. Adding a per-function noqa with an explanatory comment so reviewers see why the limit is intentionally exceeded for this one signature.
1 parent 625386f commit 8b33f42

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

adetailer/ultralytics.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,14 @@ def _apply_exclude_filter(pred, model_path: str | Path, excluded: list[str]):
7979
return pred
8080

8181

82-
def ultralytics_predict(
82+
def ultralytics_predict( # noqa: PLR0913
83+
# PLR0913 (max 5 args): six are necessary here. The upstream signature
84+
# already had five (model_path, image, confidence, device, classes); the
85+
# class-filter feature adds `exclude_classes` as a separate string so it
86+
# can be wired through a dedicated UI checkbox + textbox without changing
87+
# the long-stable `classes` semantics. Bundling both into one composite
88+
# parameter would either break call sites or hide intent at the call
89+
# site (kwargs are clearer here than a tuple/dict).
8390
model_path: str | Path,
8491
image: Image.Image,
8592
confidence: float = 0.3,

0 commit comments

Comments
 (0)