linter fixes
This commit is contained in:
parent
e2c91076f7
commit
1849075b11
1 changed files with 152 additions and 104 deletions
|
|
@ -1,10 +1,12 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
from typing import Self
|
||||
from typing import TYPE_CHECKING, Self
|
||||
|
||||
import numpy
|
||||
from numpy.typing import NDArray
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from numpy.typing import NDArray
|
||||
|
||||
|
||||
def _normalize_angle(angle_deg: int | float) -> int:
|
||||
|
|
@ -58,6 +60,6 @@ ROT2_180 = numpy.array(((-1, 0), (0, -1)), dtype=numpy.int32)
|
|||
ROT2_270 = numpy.array(((0, 1), (-1, 0)), dtype=numpy.int32)
|
||||
|
||||
|
||||
def rotation_matrix2(rotation_deg: int) -> NDArray[numpy.int32]:
|
||||
def rotation_matrix2(rotation_deg: int | float) -> NDArray[numpy.int32]:
|
||||
quadrant = (_normalize_angle(rotation_deg) // 90) % 4
|
||||
return (ROT2_0, ROT2_90, ROT2_180, ROT2_270)[quadrant]
|
||||
|
|
|
|||
Loading…
Reference in a new issue