diff options
author | 2020-05-01 08:39:45 -0700 | |
---|---|---|
committer | 2020-05-01 08:39:45 -0700 | |
commit | f8941d7e4d1a2e8388360a22e1cbf1ef7bcf2cb3 (patch) | |
tree | 572927655309cec48803999ba640918413a77292 /Examples/Modules/space_charge_initialization/analysis.py | |
parent | 639cf17fda1d048602c675c5b1808893bd29d73e (diff) | |
download | WarpX-f8941d7e4d1a2e8388360a22e1cbf1ef7bcf2cb3.tar.gz WarpX-f8941d7e4d1a2e8388360a22e1cbf1ef7bcf2cb3.tar.zst WarpX-f8941d7e4d1a2e8388360a22e1cbf1ef7bcf2cb3.zip |
Most fun PR ever: print error and tolerance before ASSERT in CI (#967)
* always print error and tolerance before ASSERT in CI tests
* eol
* fix typos
* more typo
* typo
Diffstat (limited to 'Examples/Modules/space_charge_initialization/analysis.py')
-rwxr-xr-x | Examples/Modules/space_charge_initialization/analysis.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Examples/Modules/space_charge_initialization/analysis.py b/Examples/Modules/space_charge_initialization/analysis.py index 675a8e5b5..1c90aa0dc 100755 --- a/Examples/Modules/space_charge_initialization/analysis.py +++ b/Examples/Modules/space_charge_initialization/analysis.py @@ -90,7 +90,9 @@ plt.savefig('Comparison.png') def check(E, E_th, label): print( 'Relative error in %s: %.3f'%( label, abs(E-E_th).max()/E_th.max())) - assert np.allclose( E, E_th, atol=0.1*E_th.max() ) + tolerance_rel = 0.1 + print("tolerance_rel: " + str(tolerance_rel)) + assert np.allclose( E, E_th, atol=tolerance_rel*E_th.max() ) check( Ex_array, Ex_th, 'Ex' ) check( Ey_array, Ey_th, 'Ey' ) |