Skip to content

Commit

Permalink
test: fix numpy array return type
Browse files Browse the repository at this point in the history
use numpy.typing.NDArray to type array and dtype correctly
  • Loading branch information
Olaf Haag committed Nov 8, 2023
1 parent e6db576 commit b4e819f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ repos:
rev: 'v1.5.1'
hooks:
- id: mypy
additional_dependencies: [numpy]

- repo: https://github.com/espressif/conventional-precommit-linter
rev: v1.2.1
Expand Down
3 changes: 2 additions & 1 deletion src/readyplayerme/meshops/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import TypeAlias

import numpy as np
import numpy.typing as npt
import trimesh

# Abstraction for the mesh type.
Expand Down Expand Up @@ -37,7 +38,7 @@ def read_glb(filename: str | Path) -> Mesh:
return trimesh.load(filename, process=False, force="mesh")


def get_border_vertices(mesh: Mesh) -> np.array:
def get_border_vertices(mesh: Mesh) -> npt.NDArray[np.int64]:
"""Return the indices of the vertices on the borders of a mesh.
:param mesh: The mesh to get the border vertices from.
Expand Down

0 comments on commit b4e819f

Please sign in to comment.