Skip to content

Commit

Permalink
Merge pull request #32 from pupil-labs/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
papr authored Feb 7, 2023
2 parents bb142f6 + 392f3cc commit 10a14b9
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 35 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,38 @@ on:
jobs:
build:
name: Build source and wheel distribution
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Build source package
run: |
pip install build
python -m build .
- name: Upload source package
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: distribution
path: dist/

test:
name: Test source and wheel distributions
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: [build]
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: [3.6, 3.7, 3.8, 3.9, "3.10", "3.11"]

steps:
- uses: actions/checkout@v1
- uses: actions/download-artifact@v2
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: distribution
path: dist/
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -57,8 +57,8 @@ jobs:
needs: [test]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: distribution
path: dist/
Expand Down
11 changes: 6 additions & 5 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: v4.3.0
rev: v4.4.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
Expand All @@ -12,24 +12,25 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/asottile/pyupgrade
rev: v2.37.3
rev: v3.3.1
hooks:
- id: pyupgrade
name: PyUpgrade 3.6+
args: ["--py36-plus"]
exclude: ^bin/

- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 22.6.0
rev: 23.1.0
hooks:
- id: black

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.0.0
rev: v2.2.0
hooks:
- id: setup-cfg-fmt
args: ["--min-py3-version", "3.6"]
6 changes: 4 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,21 @@ zip_safe = False
where = src

[tox:tox]
envlist = py36, py37, py38, py39
envlist = py36, py37, py38, py39, py310, py311
skip_missing_interpreters = true
isolated_build = true

[testenv]
changedir = tests
deps =
pytest
opencv-python-headless
opencv-python-headless==4.6.0.66 # last version with 3.6 abi

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
1 change: 0 additions & 1 deletion src/surface_tracker/heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def image(
size: T.Tuple[int, int],
color_format: T.Optional["SurfaceHeatmap.ColorFormat"] = None,
) -> np.ndarray:

if color_format is None:
color_format = SurfaceHeatmap.ColorFormat.RGB
elif not isinstance(color_format, SurfaceHeatmap.ColorFormat):
Expand Down
1 change: 0 additions & 1 deletion src/surface_tracker/image_crop.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ def __calculate_crop_size(
width: T.Optional[int],
height: T.Optional[int],
) -> T.Tuple[int, int]:

# compute the width of the new image, which will be the
# maximum distance between bottom-right and bottom-left
# x-coordiates or the top-right and top-left x-coordinates
Expand Down
6 changes: 0 additions & 6 deletions src/surface_tracker/location.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@


class SurfaceLocation(abc.ABC):

__versioned_subclasses = {}

def __init_subclass__(cls):
Expand Down Expand Up @@ -75,7 +74,6 @@ def transform_matrix_from_surface_to_image_undistorted(self) -> np.ndarray:
def _create_location_from_markers(
surface: Surface, markers: T.List[Marker]
) -> "SurfaceLocation":

if surface is None:
raise ValueError("Surface is None")

Expand Down Expand Up @@ -177,7 +175,6 @@ def _map_from_surface_to_image(
def _map_marker_from_image_to_surface(
self, marker: Marker, transform_matrix=None
) -> Marker:

order = CornerId.all_corners()

vertices_in_image_space = marker._vertices_in_order(order=order)
Expand All @@ -203,7 +200,6 @@ def _map_marker_from_image_to_surface(
def _map_marker_from_surface_to_image(
self, marker: Marker, transform_matrix=None
) -> Marker:

order = CornerId.all_corners()

vertices_in_surface_space = marker._vertices_in_order(order=order)
Expand Down Expand Up @@ -263,7 +259,6 @@ def __surface_to_image_transform(
def __map_points(
points: np.ndarray, transform_matrix: np.ndarray, custom_transformation=False
) -> np.ndarray:

points = np.asarray(points)

# Validate points
Expand Down Expand Up @@ -387,7 +382,6 @@ def _find_homographies(points_A, points_B):


class _SurfaceLocation_v2(SurfaceLocation):

version = 2 # type: ClassVar[int]

@property
Expand Down
1 change: 0 additions & 1 deletion src/surface_tracker/marker.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@


class Marker(abc.ABC):

# ## Abstract members

@property
Expand Down
3 changes: 0 additions & 3 deletions src/surface_tracker/surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@


class Surface(abc.ABC):

__versioned_subclasses = {}

def __init_subclass__(cls):
Expand Down Expand Up @@ -256,7 +255,6 @@ def _get_transform_to_normalized_corners(vertices: np.ndarray) -> np.ndarray:


def _bounding_quadrangle(vertices: np.ndarray):

# According to OpenCV implementation, cv2.convexHull only accepts arrays with
# 32bit floats (CV_32F) or 32bit signed ints (CV_32S).
# See: https://github.com/opencv/opencv/blob/3.4/modules/imgproc/src/convhull.cpp#L137
Expand Down Expand Up @@ -339,7 +337,6 @@ def _GetAnglesPolyline(polyline, closed=False):


class _Surface_V2(Surface):

version = 2

@property
Expand Down
3 changes: 1 addition & 2 deletions src/surface_tracker/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def move_surface_corner_positions_in_image_space(
ordered_corners, ordered_position_in_surface_space_undistorted
)

for (corner, new_undistorted) in corner_updates:
for corner, new_undistorted in corner_updates:
# TODO: Provide Surface API for moving multiple corners in one call
surface._move_corner(
corner=corner, new_position_in_surface_space_undistorted=new_undistorted
Expand Down Expand Up @@ -167,7 +167,6 @@ def add_markers_to_surface(
self.__locations_tracker.mark_locations_as_stale_for_surface(surface=surface)

for marker in markers:

marker_undistorted = location._map_marker_from_image_to_surface(
marker=marker
)
Expand Down
1 change: 0 additions & 1 deletion src/surface_tracker/visual_anchors.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class SurfaceVisualAnchors:
def _create_from_location(
location: SurfaceLocation, orientation: SurfaceOrientation
) -> "SurfaceVisualAnchors":

perimeter_corners = CornerId.all_corners()
perimeter_corners = [c.as_tuple() for c in perimeter_corners]
perimeter_corners.append(perimeter_corners[0])
Expand Down
1 change: 0 additions & 1 deletion tests/unit/test_corner.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@


def test_corner_id_all_corners():

# Test default arguments

assert [
Expand Down
1 change: 0 additions & 1 deletion update_license_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def write_header(file_name, license_txt):


if __name__ == "__main__":

# find out the cwd and change to the top level Pupil folder
cwd = os.getcwd()
pupil_dir = cwd
Expand Down

0 comments on commit 10a14b9

Please sign in to comment.