From 087bd80d2b1df598a402348093c6dc35b8f39fe3 Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Thu, 16 Jul 2020 11:13:31 -0300 Subject: [PATCH] Disable pylint too-many-locals Disable the pylint error on the two functions that involve mathematical computations that need the definition of several variables to make them more efficient. --- harmonica/forward/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/harmonica/forward/utils.py b/harmonica/forward/utils.py index cdd014215..74fed9db7 100644 --- a/harmonica/forward/utils.py +++ b/harmonica/forward/utils.py @@ -189,7 +189,7 @@ def distance_spherical_core( return dist, cospsi, coslambda -def distance_geodetic(point_p, point_q, ellipsoid): +def distance_geodetic(point_p, point_q, ellipsoid): # pylint: disable=too-many-locals """ Calculate the distance between two points in geodetic coordinates @@ -271,7 +271,7 @@ def geodetic_distance_core( prime_vertical_radius, prime_vertical_radius_p, ecc_sq, -): +): # pylint: disable=too-many-locals """ Core computation of distance between two points in geodetic coordinates @@ -301,7 +301,7 @@ def geodetic_distance_core( """ upward_sum = prime_vertical_radius + height upward_sum_p = prime_vertical_radius_p + height_p - distance = np.sqrt( + dist = np.sqrt( upward_sum_p ** 2 * cosphi_p ** 2 + upward_sum ** 2 * cosphi ** 2 - 2 * upward_sum * upward_sum_p * cosphi * cosphi_p * coslambda @@ -315,4 +315,4 @@ def geodetic_distance_core( * sinphi_p ) ) - return distance + return dist