Rewrite TestRPmatrix::test_local_exceedance_imp_pass
to not rely on loading data #915
Open
Description
Describe the bug
Following the simple installation guide, the base unit tests currently fail (for a single test). This is a simple roundoff error failure for test_local_exceedance_imp_pass
.
FAILED test_impact.py::TestRPmatrix::test_local_exceedance_imp_pass - AssertionError: 2916964966.388227 != 2916964966.388219 within 5 places (8.106231689453125e-06 difference)
To Reproduce
Steps to reproduce the behavior/error:
mamba create -n climada_env -c conda-forge climada
mamba activate climada_env
python -m unittest climada.engine.test.test_impact
Expected behavior
Tests should pass!
Climada Version: 4.1.0
System Information (please complete the following information):
- Operating system and version: MacOS 14.5. M3 Max chip.
- Python version: 3.9.18
Additional context
- This issue shows up with the most barebones install of just
climada
. It persists withclimada-petals
installed. - I tried uninstalling
bottleneck
but this didn't do the trick. I've found in the past thatbottleneck
can lead to roundoff level issues (bottleneck : Wrong mean for float32 array pydata/xarray#1346, Disable bottleneck by default? pydata/xarray#7344). - Likely has to do with updates in versioning of numpy, xarray, bottleneck, etc.