Skip to content

Commit

Permalink
refactoring 3.12 (5)
Browse files Browse the repository at this point in the history
  • Loading branch information
achevrot committed Nov 15, 2024
1 parent 62edb50 commit 3126b31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tests/sample_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

import numpy.typing as npt
from impunity import impunity
import numpy as np

meters = Annotated[npt.NDArray, "m"]
meters = Annotated[npt.NDArray[np.float], "m"]
seconds = Annotated[float, "s"]
meters_per_second = Annotated[npt.NDArray, "m/s"]
meters_per_second = Annotated[npt.NDArray[np.float], "m/s"]


@impunity
Expand Down
4 changes: 3 additions & 1 deletion tests/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ def test_keyword(self) -> None:
@impunity
def test_conversion_with_module(self) -> None:
# Using meters instead of Annotated[float, "m"]
altitudes: Annotated[npt.NDArray, "meters"] = np.arange(0, 1000, 100)
altitudes: Annotated[npt.NDArray[np.float], "meters"] = np.arange(
0, 1000, 100
)
duration: Annotated[float, "min"] = 100
result = speed_with_annotated_to_test(altitudes, duration)
self.assertAlmostEqual(result[3], 0.05, delta=1e-2)
Expand Down

0 comments on commit 3126b31

Please sign in to comment.