Closed groutr closed 8 months ago
Great, let me know when this is ready to review and pull in.
After looking at the code some more, I realized for some functions, it would be easy to extend the computation to the borders with the appropriate bounds checking.
An additional minor improvement in this PR is to call the scalar versions of sqrt, abs, atan2, and hypot. Using the scalar functions on scalar inputs is much faster than the equivalent numpy versions. For example:
In [7]: %timeit np.abs(-5.32)
678 ns ± 6.14 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)
In [8]: %timeit abs(-5.32)
26.3 ns ± 0.383 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each)
I believe this PR is ready for review.
LGTM
A continuation of #235 that extends the same fix to the other routines of _sgrid.py.