Open-EO / openeo-processes-python

A Python representation of (most) openEO processes
Apache License 2.0
11 stars 4 forks source link

Fix currently skipped tests #185

Open LukeWeidenwalker opened 2 years ago

LukeWeidenwalker commented 2 years ago

I've skipped tests that are currently failing to get towards a green build as part of #177, but before releasing a new version, we should really sit down and fix those.

ValentinaHutter commented 2 years ago

@LukeWeidenwalker Can you please double check if test_ln is really failing for you? :)

ValentinaHutter commented 2 years ago

@LukeWeidenwalker Can you please double check if test_ln is really failing for you? :)

While the test_ln was successful in my local devcontainer, it failed in the CI/CD pipeline, because it computed ln(e) = 0.9999999999999 instead of 1, so I now used assert_almost_equal.

LukeWeidenwalker commented 2 years ago

This is an issue with precision in floating-point arithmetic, see https://stackoverflow.com/questions/931995/inaccurate-logarithm-in-python for more context. I'm not an expert at all, but afaik this can vary across different hardware platforms. I think the right thing to do is what already did and use assert_almost_equal.