Closed paulf81 closed 1 month ago
Interesting; presumably this was introduced when I updated the reg test comparison values in #934 .
Tests pass for me locally, with the following package versions:
python = 3.10.6
numpy = 1.25.1
pandas = 1.5.0
scipy = 1.11.1
@paulf81 , if you switch the DEBUG
flag to True
at the top of the file, what gets printed out for locations_opt
?
Ah you're right, this appears to be a precision thing, I can only spot it when following assert_results_arrays
in debug, but for example this now passes, if I change the final checks to:
np.allclose(locations_opt, locations_baseline_aep, atol=1e-1)
assert np.abs((optimized_aep - baseline_aep)/baseline_aep) < 0.01
But as is both are just different enough to fail
Ok, I think we could switch to using np.allclose
instead of the assert_results_arrays()
to give us the tolerance options (or add optional atol
and rtol
keyword arguments to assert_results_arrays()
for better future-proofing)?
Hi @misi9170 , somehow I was a bit wrong about this, the answers are just quite different if I don't run in debug mode.
I changed the DEBUG output to:
print(locations_baseline_aep)
print(locations_opt)
print('----------------')
print(baseline_aep)
print(optimized_aep)
If I run the test normally this is:
[[ 0. 619.07183266 1260. ]
[ 0. 499.88056089 0. ]]
[[ 0. 440.07873658 1260. ]
[ 0. 563.92108396 0. ]]
----------------
44798828639.17205
44841782747.77768
But if I run it in debug mode:
[[ 0. 619.07183266 1260. ]
[ 0. 499.88056089 0. ]]
[[ 0. 619.07183266 1260. ]
[ 0. 499.88056089 0. ]]
----------------
44798828639.17205
44798828639.17205
So I get the matched results when I run in debug, but pretty different if I just run :
pytest -rA tests/
Closed by #940
test_random_search_layout_opt
is failing locally on my machine but not on githubI think this must be a difference in package version, or os, but on the version of develop (current July 4), running
test_random_search_layout_opt
produces the error:How to reproduce
Run
test_random_search_layout_opt
in develop on local machineSystem Information