From 6d143d97ad0b9f5acadf881cefdf00ff7806e2f2 Mon Sep 17 00:00:00 2001 From: Huite Bootsma Date: Mon, 11 Dec 2023 09:25:14 +0100 Subject: [PATCH] consistent return --- numba_celltree/algorithms/barycentric_wachspress.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/numba_celltree/algorithms/barycentric_wachspress.py b/numba_celltree/algorithms/barycentric_wachspress.py index 39b8a00..8fd30e3 100644 --- a/numba_celltree/algorithms/barycentric_wachspress.py +++ b/numba_celltree/algorithms/barycentric_wachspress.py @@ -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 @@ -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 @@ -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