Skip to content

Follow imports on mypy #2461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ optional-dependencies.dev = [
"freezegun==1.5.1",
"furo==2024.8.6",
"interrogate==1.7.0",
"mypy[faster-cache]==1.13.0",
"mypy[faster-cache]==1.14.0",
"pre-commit==4.0.1",
"pydocstyle==6.3",
"pyenchant==3.3.0rc1",
Expand Down Expand Up @@ -384,6 +384,7 @@ exclude = [ "build" ]
plugins = [
"pydantic.mypy",
]
follow_untyped_imports = true

[tool.pyright]
reportUnnecessaryTypeIgnoreComment = true
Expand Down
4 changes: 2 additions & 2 deletions src/mock_vws/target_raters.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
from typing import Protocol, runtime_checkable

import numpy as np
import piq # type: ignore[import-untyped]
import torch
from beartype import beartype
from PIL import Image
from piq.brisque import brisque # pyright: ignore[reportMissingTypeStubs]


@functools.cache
Expand All @@ -38,7 +38,7 @@ def _get_brisque_target_tracking_rating(*, image_content: bytes) -> int:
)
image_tensor = image_tensor.permute(2, 0, 1).unsqueeze(dim=0)
try:
brisque_score = piq.brisque(x=image_tensor, data_range=255)
brisque_score = brisque(x=image_tensor, data_range=255)
except (AssertionError, IndexError):
return 0
return math.ceil(int(brisque_score.item()) / 20)
Expand Down
Loading