Skip to content

Commit 0d80ae7

Browse files
committed
Remove dependency on nptyping completely
1 parent e174f5e commit 0d80ae7

File tree

5 files changed

+22
-19
lines changed

5 files changed

+22
-19
lines changed

hpmoc-dev-win.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,4 @@ dependencies:
3636
#- icc_rt # -c numba
3737
#- intelpython3_full # -c intel
3838
# pip
39-
- pip:
40-
- nptyping=1.4.4
39+

hpmoc-dev.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,3 @@ dependencies:
4040
#- icc_rt # -c numba
4141
#- intelpython3_full # -c intel
4242
# pip
43-
- pip:
44-
- nptyping=1.4.4

hpmoc/atlas/__init__.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
"Work with manifolds."
22

3-
from nptyping import NDArray, Shape, Int, Bool, Int64
3+
# This file is currently in a broken state
4+
5+
import numpy as np
6+
from numpy.typing import NDArray
7+
48
from typing import Tuple, Callable, List, Union, Optional, Any
59

10+
Int = np.integer[Any]
11+
Bool = np.bool_
12+
613
Connector = Callable[
714
[NDArray[Int], NDArray[Int], NDArray[Int]],
815
Tuple[NDArray[Bool], NDArray[Int], NDArray[Int], NDArray[Int]]
916
]
10-
Limits = NDArray[Shape["2, ..."], Int]
17+
Limits = NDArray[Int]
1118

1219

1320
# TODO account for LHS/RHS heterogeneous atlases
@@ -276,8 +283,8 @@ def healpix_grid_limits(nside):
276283
def idx_in_chart(
277284
x: NDArray[Int],
278285
y: NDArray[Int],
279-
x_limits: NDArray[Shape["2, ..."], Int],
280-
y_limits: NDArray[Shape["2, ..."], Int],
286+
x_limits: NDArray[Int],
287+
y_limits: NDArray[Int],
281288
) -> NDArray[Bool]:
282289
"""
283290
See which indices are contained in a chart. This notion can be used to
@@ -445,14 +452,14 @@ def _empty_translate():
445452
import numpy as np
446453

447454
return (
448-
np.array([], dtype=np.bool),
455+
np.array([], dtype=np.bool_),
449456
np.array([], dtype=np.int64),
450457
np.array([], dtype=np.int64),
451458
np.array([], dtype=np.int64),
452459
)
453460

454461

455-
def square_matrix_connectors() -> NDArray[Shape["4, 4, 2, 3"], Int64]:
462+
def square_matrix_connectors() -> NDArray[np.int64]:
456463
"""
457464
Matrices for connecting identically-sized square charts to each other.
458465

hpmoc/plot.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@
215215
)
216216
from .points import PointsTuple
217217

218-
if TYPE_CHECKING:
219-
from nptyping import NDArray, Int
218+
import numpy as np
219+
from numpy.typing import NDArray
220220

221221
DEFAULT_CBAR_KWARGS = {
222222
'orientation': 'horizontal',
@@ -601,12 +601,12 @@ def get_projection(projection, *args, **kwargs):
601601
def plot(
602602
skymap: Union[
603603
'hpmoc.PartialUniqSkymap',
604-
NDArray[Any, Any],
604+
NDArray[Any],
605605
Tuple[
606-
NDArray[Any, Any],
606+
NDArray[Any],
607607
Optional[
608608
Union[
609-
NDArray[Any, Int],
609+
NDArray[np.integer[Any]],
610610
'astropy.wcs.WCS',
611611
str,
612612
]
@@ -1050,12 +1050,12 @@ def plot(
10501050
def gridplot(
10511051
*skymaps: Union[
10521052
'hpmoc.PartialUniqSkymap',
1053-
NDArray[Any, Any],
1053+
NDArray[Any],
10541054
Tuple[
1055-
NDArray[Any, Any],
1055+
NDArray[Any],
10561056
Optional[
10571057
Union[
1058-
NDArray[Any, Int],
1058+
NDArray[np.integer[Any]],
10591059
'astropy.wcs.WCS',
10601060
str,
10611061
]

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ requires = [
1111
"numpy",
1212
"matplotlib",
1313
"astropy",
14-
"nptyping~=2.4.1",
1514
"astropy-healpix"
1615
]
1716
requires-python = ">=3.6"

0 commit comments

Comments
 (0)