Skip to content

Commit 6217431

Browse files
authored
Use nptyping v2.x (#1050)
1 parent d4b5eec commit 6217431

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

cadquery/occ_impl/sketch_solver.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from typing import Tuple, Union, Any, Callable, List, Optional, Iterable, Dict, Sequence
22
from typing_extensions import Literal
33
from nptyping import NDArray as Array
4+
from nptyping import Float
45
from itertools import accumulate, chain
56
from math import sin, cos, radians
67

@@ -262,12 +263,12 @@ def __init__(
262263
self.ixs = [0] + list(accumulate(len(e) for e in self.entities))
263264

264265
def _cost(
265-
self, x0: Array[(Any,), float]
266+
self, x0: Array[Any, Float]
266267
) -> Tuple[
267-
Callable[[Array[(Any,), float]], float],
268-
Callable[[Array[(Any,), float], Array[(Any,), float]], None],
269-
Array[(Any,), float],
270-
Array[(Any,), float],
268+
Callable[[Array[Any, Float]], float],
269+
Callable[[Array[Any, Float], Array[Any, Float]], None],
270+
Array[Any, Float],
271+
Array[Any, Float],
271272
]:
272273

273274
ixs = self.ixs

cadquery/occ_impl/solver.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
Type,
1212
)
1313
from nptyping import NDArray as Array
14+
from nptyping import Float
1415
from math import radians
1516
from typish import instance_of, get_type
1617
from numpy import array, eye, pi
@@ -448,8 +449,8 @@ def _build_transform(
448449
def _cost(
449450
self,
450451
) -> Tuple[
451-
Callable[[Array[(Any,), float]], float],
452-
Callable[[Array[(Any,), float], Array[(Any,), float]], None],
452+
Callable[[Array[Any, Float]], float],
453+
Callable[[Array[Any, Float], Array[Any, Float]], None],
453454
]:
454455

455456
constraints = self.constraints

conda/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ requirements:
2020
- ezdxf
2121
- ipython
2222
- typing_extensions
23-
- nptyping
23+
- nptyping >=2.0.0
2424
- nlopt
2525
- multimethod 1.6
2626

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies:
1919
- ezdxf
2020
- ipython
2121
- typing_extensions
22-
- nptyping
22+
- nptyping>=2.0.0
2323
- nlopt
2424
- path
2525
- pip

0 commit comments

Comments
 (0)