Skip to content

Commit 990654b

Browse files
committed
Run pre-commit
1 parent 60a0e8a commit 990654b

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

dlclivegui/services/dlc_processor.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
class PoseResult:
3838
pose: np.ndarray | None
3939
timestamp: float
40-
packet: "PosePacket | None" = None
40+
packet: PosePacket | None = None
4141

4242

4343
@dataclass(slots=True, frozen=True)
4444
class PoseSource:
45-
backend: str # e.g. "DLCLive"
45+
backend: str # e.g. "DLCLive"
4646
model_type: ModelType | None = None
4747

4848

@@ -73,19 +73,22 @@ def validate_pose_array(pose: Any, *, source_backend: str = "DLCLive") -> np.nda
7373

7474
if arr.ndim not in (2, 3):
7575
raise ValueError(
76-
f"{source_backend} returned an invalid pose output format: expected a 2D or 3D array, got ndim={arr.ndim}, shape={arr.shape!r}"
76+
f"{source_backend} returned an invalid pose output format:"
77+
f" expected a 2D or 3D array, got ndim={arr.ndim}, shape={arr.shape!r}"
7778
)
7879

7980
if arr.shape[-1] != 3:
8081
raise ValueError(
81-
f"{source_backend} returned an invalid pose output format: expected last dimension size 3 (x, y, likelihood), got shape={arr.shape!r}"
82+
f"{source_backend} returned an invalid pose output format:"
83+
f" expected last dimension size 3 (x, y, likelihood), got shape={arr.shape!r}"
8284
)
8385

8486
if arr.ndim == 2 and arr.shape[0] <= 0:
8587
raise ValueError(f"{source_backend} returned an invalid pose output format: expected at least one keypoint")
8688
if arr.ndim == 3 and (arr.shape[0] <= 0 or arr.shape[1] <= 0):
8789
raise ValueError(
88-
f"{source_backend} returned an invalid pose output format: expected at least one individual and one keypoint, got shape={arr.shape!r}"
90+
f"{source_backend} returned an invalid pose output format:"
91+
f" expected at least one individual and one keypoint, got shape={arr.shape!r}"
8992
)
9093

9194
if not np.issubdtype(arr.dtype, np.number):

tests/compat/test_dlclive_package_compat.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
def _get_signature_params(callable_obj) -> tuple[set[str], bool]:
1313
"""
1414
Return allowed keyword names for callable, allowing for **kwargs.
15-
15+
1616
Example:
1717
>>> params, accepts_var_kw = _get_signature_params(lambda x, y, **kwargs: None, {"x", "y"})
1818
>>> params == {"x", "y"}
@@ -56,7 +56,7 @@ def test_dlclive_constructor_accepts_gui_expected_kwargs():
5656
params, accepts_var_kw = _get_signature_params(DLCLive.__init__)
5757
missing = {name for name in expected if name not in params}
5858
assert not missing, f"DLCLive.__init__ is missing expected kwargs called by GUI: {sorted(missing)}"
59-
assert accepts_var_kw, "DLCLive.__init__ should accept **kwargs" # captures current behavior
59+
assert accepts_var_kw, "DLCLive.__init__ should accept **kwargs" # captures current behavior
6060

6161

6262
@pytest.mark.dlclive_compat
@@ -100,6 +100,7 @@ def test_dlclive_minimal_inference_smoke():
100100
model_type = os.getenv("DLCLIVE_TEST_MODEL_TYPE", "pytorch").strip() or "pytorch"
101101

102102
from dlclive import DLCLive # noqa: PLC0415
103+
103104
from dlclivegui.services.dlc_processor import validate_pose_array # noqa: PLC0415
104105

105106
dlc = DLCLive(

0 commit comments

Comments
 (0)