Skip to content

Commit

Permalink
Remove nptyping package
Browse files Browse the repository at this point in the history
Importing nptyping with numpy>=2.0.0 now raises exceptions
instead of warnings for deprecated dtypes.

ramonhagenaars/nptyping#114
ramonhagenaars/nptyping#113
ramonhagenaars/nptyping#102
  • Loading branch information
nocarryr committed Jun 16, 2024
1 parent c58c2cd commit 4d16351
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 21 deletions.
1 change: 0 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ipython = "*"
matplotlib = "*"
jupyterlab = "*"
pytest = "*"
nptyping = "*"
pytest-xdist = "*"

[requires]
Expand Down
11 changes: 1 addition & 10 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 5 additions & 10 deletions src/lupy/types.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
from typing import Any
import warnings

import numpy as np
import numpy.typing as npt

with warnings.catch_warnings(category=DeprecationWarning):
warnings.simplefilter('ignore')
from nptyping import NDArray, Structure


__all__ = (
'Floating', 'Complex', 'MeterDtype', 'MeterStruct', 'MeterArray',
'Floating', 'Complex', 'MeterDtype', 'MeterArray',
'AnyArray', 'BoolArray', 'IndexArray', 'FloatArray', 'ComplexArray',
'Float1dArray', 'Float2dArray', 'Float3dArray',
)
Expand All @@ -25,15 +21,14 @@
('s', np.float64),
])

MeterStruct = Structure['t: Floating, m: Floating, s: Floating']


AnyArray = npt.NDArray[Any]
BoolArray = npt.NDArray[np.bool_]
IndexArray = npt.NDArray[np.intp]
FloatArray = npt.NDArray[Floating]
ComplexArray = npt.NDArray[Complex]
MeterArray = NDArray[Any, MeterStruct]
Float1dArray = npt.NDArray[Floating]#NDArray[Shape['*'], _Floating]
Float2dArray = npt.NDArray[Floating]#NDArray[Shape['*, *'], _Floating]
Float3dArray = npt.NDArray[Floating]#NDArray[Shape['*, *, *'], _Floating]
MeterArray = npt.NDArray[np.void]
Float1dArray = npt.NDArray[Floating]
Float2dArray = npt.NDArray[Floating]
Float3dArray = npt.NDArray[Floating]

0 comments on commit 4d16351

Please sign in to comment.