Skip to content

Commit

Permalink
Improve docstring and remove comment
Browse files Browse the repository at this point in the history
  • Loading branch information
santisoler authored Oct 2, 2024
1 parent 177a119 commit 71347c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions choclo/prism/_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ def _safe_log(x, y, z, r):
([Fukushima2020]_).
* If :math:`x < 0, r = |x|`, then it returns one of the terms of the limit
of the second-order kernels (when the observation point is inline with
two nodes): :math;`-\ln(-2x)`.
two nodes): :math:`-\ln(-2x)`.
When checking if :math:`r = |x|`, we will evaluate if ``y == 0.0 and z ==
0.0``, to avoid issues with floating point errors in cases in which
Expand All @@ -893,7 +893,7 @@ def _safe_log(x, y, z, r):
if r == 0:
return 0
if x < 0:
if y == 0.0 and z == 0.0: # equivalent to if r == -x
if y == 0.0 and z == 0.0:
result = -np.log(-2 * x)
else:
result = np.log((y**2 + z**2) / (r - x))
Expand Down

0 comments on commit 71347c1

Please sign in to comment.