Skip to content

Commit ac3c8db

Browse files
Merge pull request #2461 from VWS-Python/follow-imports
Follow imports on mypy
2 parents 43983e2 + 4264e3a commit ac3c8db

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ optional-dependencies.dev = [
6464
"freezegun==1.5.1",
6565
"furo==2024.8.6",
6666
"interrogate==1.7.0",
67-
"mypy[faster-cache]==1.13.0",
67+
"mypy[faster-cache]==1.14.0",
6868
"pre-commit==4.0.1",
6969
"pydocstyle==6.3",
7070
"pyenchant==3.3.0rc1",
@@ -384,6 +384,7 @@ exclude = [ "build" ]
384384
plugins = [
385385
"pydantic.mypy",
386386
]
387+
follow_untyped_imports = true
387388

388389
[tool.pyright]
389390
reportUnnecessaryTypeIgnoreComment = true

src/mock_vws/target_raters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
from typing import Protocol, runtime_checkable
1010

1111
import numpy as np
12-
import piq # type: ignore[import-untyped]
1312
import torch
1413
from beartype import beartype
1514
from PIL import Image
15+
from piq.brisque import brisque # pyright: ignore[reportMissingTypeStubs]
1616

1717

1818
@functools.cache
@@ -38,7 +38,7 @@ def _get_brisque_target_tracking_rating(*, image_content: bytes) -> int:
3838
)
3939
image_tensor = image_tensor.permute(2, 0, 1).unsqueeze(dim=0)
4040
try:
41-
brisque_score = piq.brisque(x=image_tensor, data_range=255)
41+
brisque_score = brisque(x=image_tensor, data_range=255)
4242
except (AssertionError, IndexError):
4343
return 0
4444
return math.ceil(int(brisque_score.item()) / 20)

0 commit comments

Comments
 (0)