Skip to content

Commit

Permalink
consistent return
Browse files Browse the repository at this point in the history
  • Loading branch information
Huite committed Dec 11, 2023
1 parent b8f187c commit 6d143d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions numba_celltree/algorithms/barycentric_wachspress.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def interp_edge_case(a, U, p, weights, i, j):


@nb.njit
def compute_weights(polygon: FloatArray, p: Point, weights: FloatArray):
def compute_weights(polygon: FloatArray, p: Point, weights: FloatArray) -> None:
n = len(polygon)
w_sum = 0.0

Expand All @@ -43,7 +43,7 @@ def compute_weights(polygon: FloatArray, p: Point, weights: FloatArray):
# Note: weights may be differently sized than polygon! Hence n-1
# instead of -1.
interp_edge_case(a, U, p, weights, n - 1, 0)
return weights
return

for i in range(n):
i_next = (i + 1) % n
Expand All @@ -58,7 +58,7 @@ def compute_weights(polygon: FloatArray, p: Point, weights: FloatArray):

if Aj < TOLERANCE_ON_EDGE:
interp_edge_case(b, V, p, weights, i, i_next)
return weights
return

w = 2 * Ci / (Ai * Aj)
weights[i] = w
Expand Down

0 comments on commit 6d143d9

Please sign in to comment.