Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

update pytest 7.1.2; pytest-flake8 1.1.1; flake8 4.0.1 (#1786)

Edgar Ribac6812384c938
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 9fa64d84b..aa5ecc9ef 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -23,7 +23,7 @@ jobs:
shell: bash -l {0}
run: |
pip install -r docs/requirements.txt
- pip install .[all]
+ pip install .
- name: Build Documentation
shell: bash -l {0}
run: make build-docs
diff --git a/kornia/geometry/depth.py b/kornia/geometry/depth.py
index 7fadd2921..b3797e5c1 100644
--- a/kornia/geometry/depth.py
+++ b/kornia/geometry/depth.py
@@ -249,7 +249,7 @@ class DepthWarper(nn.Module):
raise ValueError("Please, call compute_projection_matrix.")
point = torch.tensor(
- [[[x], [y], [1.0], [invd]]], device=self._dst_proj_src.device, dtype=self._dst_proj_src.dtype
+ [[[x], [y], [invd], [1.0]]], device=self._dst_proj_src.device, dtype=self._dst_proj_src.dtype
)
flow = torch.matmul(self._dst_proj_src, point)
z = 1.0 / flow[:, 2]
diff --git a/requirements/dev.txt b/requirements/dev.txt
index af0f9d2a7..96a526f50 100644
--- a/requirements/dev.txt
+++ b/requirements/dev.txt
@@ -1,13 +1,10 @@
-pytest==6.2.5
-pytest-flake8==1.0.7
-flake8==3.9.2 # flake8==4.0.1 is buggy
+pytest==7.1.2
+pytest-flake8==1.1.1
+flake8==4.0.1
pytest-cov==3.0.0
pytest-mypy==0.9.1
-pytest-xdist==2.5.0
-autopep8
pydocstyle
pre-commit>=2.0
-yapf
isort
numpy
scipy
diff --git a/test/geometry/test_depth_warper.py b/test/geometry/test_depth_warper.py
index 2a7f9edf8..da6392ca9 100644
--- a/test/geometry/test_depth_warper.py
+++ b/test/geometry/test_depth_warper.py
@@ -151,7 +151,7 @@ class TestDepthWarper:
# test compute_subpixel_step
subpixel_step = warper.compute_subpixel_step()
- assert pytest.approx(subpixel_step.item(), 0.3536)
+ assert_close(subpixel_step.item(), 0.1715, rtol=1e-3, atol=1e-3)
@pytest.mark.parametrize("batch_size", (1, 2))
def test_gradcheck(self, batch_size, device, dtype):
diff --git a/test/utils/test_one_hot.py b/test/utils/test_one_hot.py
index a77a54c4f..3c3b3d381 100644
--- a/test/utils/test_one_hot.py
+++ b/test/utils/test_one_hot.py
@@ -1,7 +1,7 @@
-import pytest
import torch
import kornia
+from kornia.testing import assert_close
class TestOneHot:
@@ -16,7 +16,7 @@ class TestOneHot:
# convert labels to one hot tensor
one_hot = kornia.utils.one_hot(labels, num_classes)
- assert pytest.approx(one_hot[0, labels[0, 0, 0], 0, 0].item(), 1.0)
- assert pytest.approx(one_hot[0, labels[0, 1, 0], 1, 0].item(), 1.0)
- assert pytest.approx(one_hot[1, labels[1, 0, 0], 0, 0].item(), 1.0)
- assert pytest.approx(one_hot[1, labels[1, 1, 0], 1, 0].item(), 1.0)
+ assert_close(one_hot[0, labels[0, 0, 0], 0, 0].item(), 1.0)
+ assert_close(one_hot[0, labels[0, 1, 0], 1, 0].item(), 1.0)
+ assert_close(one_hot[1, labels[1, 0, 0], 0, 0].item(), 1.0)
+ assert_close(one_hot[1, labels[1, 1, 0], 1, 0].item(), 1.0)