Skip to content
Open
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
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v5.0.0"
rev: "v6.0.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -15,17 +15,17 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.1
hooks:
- id: codespell
args: ["--ignore-words-list=socio-economic"]
exclude: "BIBLIOGRAPHY.bib|CONTRIBUTORS.rst|.*.ipynb"
- repo: https://github.com/PyCQA/isort
rev: "5.13.2"
rev: "6.0.1"
hooks:
- id: isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.8.2"
rev: "v0.12.11"
hooks:
- id: ruff-format
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion colour_checker_detection/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

try:
_version = (
subprocess.check_output( # noqa: S603
subprocess.check_output(
["git", "describe"], # noqa: S607
cwd=os.path.dirname(__file__),
stderr=subprocess.STDOUT,
Expand Down
10 changes: 5 additions & 5 deletions colour_checker_detection/detection/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ def transform_image(
transform += as_float32_array([[0, 0, t_x], [0, 0, t_y]])

return cast(
NDArrayReal,
"NDArrayReal",
cv2.warpAffine(
image,
transform,
Expand Down Expand Up @@ -650,14 +650,14 @@ def detect_contours(
iterations=settings.convolution_iterations,
)

image_k = cast(NDArrayReal, image_k)
image_k = cast("NDArrayReal", image_k)

# Detecting contours.
contours, _hierarchy = cv2.findContours(
image_k, cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE
)

contours = cast(Tuple[NDArrayInt], contours)
contours = cast("Tuple[NDArrayInt]", contours)

if additional_data:
return contours, image_k
Expand Down Expand Up @@ -827,7 +827,7 @@ def approximate_contour(
contour, center * cv2.arcLength(contour, True), True
)

approximation = cast(NDArrayInt, approximation)
approximation = cast("NDArrayInt", approximation)

if len(approximation) > points:
low = (low + high) / 2
Expand Down Expand Up @@ -1155,7 +1155,7 @@ def sample_colour_checker(
colour_checker = colour_checker_candidate
quadrilateral = candidate_quadrilateral

colour_checker = cast(NDArrayFloat, colour_checker)
colour_checker = cast("NDArrayFloat", colour_checker)

return DataDetectionColourChecker(
sampled_colours, masks, colour_checker, quadrilateral
Expand Down
2 changes: 1 addition & 1 deletion colour_checker_detection/detection/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def detect_colour_checkers_inference(
if apply_cctf_decoding:
image = cctf_decoding(image)

image = cast(NDArrayReal, image)
image = cast("NDArrayReal", image)

rectangle = as_int32_array(
[
Expand Down
2 changes: 1 addition & 1 deletion colour_checker_detection/detection/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def detect_colour_checkers_segmentation(
if apply_cctf_decoding:
image = cctf_decoding(image)

image = cast(NDArrayReal, image)
image = cast("NDArrayReal", image)

image = reformat_image(image, settings.working_width, settings.interpolation_method)

Expand Down
2 changes: 1 addition & 1 deletion utilities/export_todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def extract_todo_items(root_directory: str) -> dict:

if in_todo and line.startswith("#"):
todo_item.append(line.replace("#", "").strip())
elif len(todo_item):
elif todo_item:
key = filename.replace("../", "")
if not todo_items.get(key):
todo_items[key] = []
Expand Down
Loading