|
4 | 4 | from math import factorial, sqrt |
5 | 5 |
|
6 | 6 | import scipy.spatial |
| 7 | +from numpy import abs as np_abs |
7 | 8 | from numpy import ( |
8 | | - abs, |
9 | 9 | array, |
10 | 10 | asarray, |
11 | 11 | average, |
|
17 | 17 | square, |
18 | 18 | subtract, |
19 | 19 | ) |
20 | | -from numpy import sum as nsum |
| 20 | +from numpy import sum as np_sum |
21 | 21 | from numpy import zeros |
22 | 22 | from numpy.linalg import det as ndet |
23 | 23 | from numpy.linalg import matrix_rank, norm, slogdet, solve |
@@ -163,7 +163,7 @@ def circumsphere(pts): |
163 | 163 | return fast_3d_circumcircle(pts) |
164 | 164 |
|
165 | 165 | # Modified method from http://mathworld.wolfram.com/Circumsphere.html |
166 | | - mat = array([[nsum(square(pt)), *pt, 1] for pt in pts]) |
| 166 | + mat = array([[np_sum(square(pt)), *pt, 1] for pt in pts]) |
167 | 167 | center = zeros(dim) |
168 | 168 | a = 1 / (2 * ndet(mat[:, 1:])) |
169 | 169 | factor = a |
@@ -560,7 +560,7 @@ def _relative_volume(self, simplex): |
560 | 560 | is to check that a simplex is almost flat.""" |
561 | 561 | vertices = array(self.get_vertices(simplex)) |
562 | 562 | vectors = vertices[1:] - vertices[0] |
563 | | - average_edge_length = mean(abs(vectors)) |
| 563 | + average_edge_length = mean(np_abs(vectors)) |
564 | 564 | return self.volume(simplex) / (average_edge_length ** self.dim) |
565 | 565 |
|
566 | 566 | def add_point(self, point, simplex=None, transform=None): |
|
0 commit comments