Closed ojeda-e closed 8 months ago
Hello @ojeda-e! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
membrane_curvature/tests/test_membrane_curvature.py
:The pushed changes include:
assert_almost_equal
by assert_allclose
. For two assertions I set tolerance to rtol=6
otherwise the tests fail. Not sure you are ok with this change. (Thanks @tylerjereddy for the suggestion and @orbeckst for confirming)base.py
and tests for grids of different sizes and with a different number of undefined values. base.py
, kept the data for z_surface
and interpolated_z_surface
as suggested by @lilyminium.I know base.py
could be written better, but maybe we can leave that improvement for later and work on the essentials for now if that's ok.
Hopefully I am not missing relevant things here. Thanks!
@lilyminium sorry, it's my fault because I made a bit of a mess here.
To clarify.
def test_mean_curvature_small
passes with assert_allclose
. I don't know why I ended up adding rtol
it should go. (I added the comment here)
The problem is in def test_gaussian_curvature_all
. The test passes with rtol=4
or atol=1e-7
. From the docs it says allclose
"... compares the difference between actual and desired to atol + rtol * abs(desired)."
So probably better have assert_allclose(k, k_test, atol=1e-7)
?
So probably better have assert_allclose(k, k_test, atol=1e-7) ?
I think so. Even if you know yourself that the 400% difference is small because the real value is small, it communicates to future users that you expect the degree of difference to be around 0.0000001.
This is a starting point to solve #45
Changes in this PR:
surface_interpolation
). Includes docstrings.surface_interpolation
.As suggested by @orbeckst in this comment, the function here included uses NumPy. Thanks for encouraging numpy!
Surfaces included in tests are dummy_arrays with the following characteristics:
np.nan
.np.nan
.np.nan
.np.nan
. 💪🏽Probably I'll be asked to add more tests, but this is ok to start. Probably @lilyminium will give me lots of ideas. 😅
Thanks.