diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 6de734cc6da..7b6eb1ed256 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -112,6 +112,10 @@ jobs: -Duse_cmake_find_lapack=ON -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON fi # Python modules required for test analysis + # (remove system copy of Matplotlib to avoid conflict + # with version set in the requirements file - see, e.g., + # https://github.com/matplotlib/matplotlib/issues/28768) + sudo apt remove python3-matplotlib python3 -m pip install --upgrade -r Regression/requirements.txt python3 -m pip cache purge # external repositories required for test analysis diff --git a/Examples/Tests/collision/CMakeLists.txt b/Examples/Tests/collision/CMakeLists.txt index 92fb9ecdb9e..04679ab2578 100644 --- a/Examples/Tests/collision/CMakeLists.txt +++ b/Examples/Tests/collision/CMakeLists.txt @@ -17,7 +17,7 @@ add_warpx_test( 1 # nprocs inputs_test_2d_collision_xz # inputs "analysis_collision_2d.py diags/diag1000150" # analysis - "analysis_default_regression.py --path diags/diag1000150" # checksum + "analysis_default_regression.py --path diags/diag1000150 --rtol 1e-1" # checksum OFF # dependency ) @@ -27,7 +27,7 @@ add_warpx_test( 1 # nprocs inputs_test_2d_collision_xz_picmi.py # inputs "analysis_collision_2d.py diags/diag1000150" # analysis - "analysis_default_regression.py --path diags/diag1000150" # checksum + "analysis_default_regression.py --path diags/diag1000150 --rtol 1e-1" # checksum OFF # dependency ) diff --git a/Examples/Tests/implicit/analysis_vandb_jfnk_2d.py b/Examples/Tests/implicit/analysis_vandb_jfnk_2d.py index dcbacdfde1f..d7b8aa4e17e 100755 --- a/Examples/Tests/implicit/analysis_vandb_jfnk_2d.py +++ b/Examples/Tests/implicit/analysis_vandb_jfnk_2d.py @@ -26,7 +26,7 @@ # This case should have near machine precision conservation of energy tolerance_rel_energy = 2.0e-14 -tolerance_rel_charge = 2.0e-15 +tolerance_rel_charge = 2.0e-11 print(f"max change in energy: {max_delta_E}") print(f"tolerance: {tolerance_rel_energy}") diff --git a/Examples/Tests/nuclear_fusion/CMakeLists.txt b/Examples/Tests/nuclear_fusion/CMakeLists.txt index 74d937601bd..4c910a232b4 100644 --- a/Examples/Tests/nuclear_fusion/CMakeLists.txt +++ b/Examples/Tests/nuclear_fusion/CMakeLists.txt @@ -7,7 +7,7 @@ add_warpx_test( 2 # nprocs inputs_test_2d_proton_boron_fusion # inputs "analysis_proton_boron_fusion.py diags/diag1000001" # analysis - "analysis_default_regression.py --path diags/diag1000001" # checksum + "analysis_default_regression.py --path diags/diag1000001 --rtol 1e-1" # checksum OFF # dependency ) diff --git a/Examples/Tests/nuclear_fusion/analysis_proton_boron_fusion.py b/Examples/Tests/nuclear_fusion/analysis_proton_boron_fusion.py index 917cd86f258..82472b7f0ae 100755 --- a/Examples/Tests/nuclear_fusion/analysis_proton_boron_fusion.py +++ b/Examples/Tests/nuclear_fusion/analysis_proton_boron_fusion.py @@ -80,7 +80,7 @@ ## Checks whether this is the 2D or the 3D test with open("./warpx_used_inputs") as warpx_used_inputs: - is_2D = re.search("geometry.dims\s*=\s*2", warpx_used_inputs.read()) + is_2D = re.search("geometry.dims = 2", warpx_used_inputs.read()) warpx_used_inputs.close() ## Some numerical parameters for this test @@ -698,7 +698,7 @@ def check_initial_energy2(data): ## statistics and an event like alpha1 emitted exactly in direction of proton & alpha2 ## emitted exactly in direction opposite to Beryllium is somewhat rare. assert is_close( - np.amax(energy_alpha2_simulation), max_energy_alpha23, rtol=5e-2 + np.amax(energy_alpha2_simulation), max_energy_alpha23, rtol=1e-1 ) assert is_close( np.amin(energy_alpha2_simulation), min_energy_alpha23, atol=3.218e-14 diff --git a/Examples/Tests/pml/analysis_pml_psatd.py b/Examples/Tests/pml/analysis_pml_psatd.py index 156f58362ce..79588dd4d40 100755 --- a/Examples/Tests/pml/analysis_pml_psatd.py +++ b/Examples/Tests/pml/analysis_pml_psatd.py @@ -44,7 +44,7 @@ energyB = np.sum(0.5 / scc.mu_0 * (Bx**2 + By**2 + Bz**2)) energy_start_diags = energyE + energyB error = abs(energy_start - energy_start_diags) / energy_start -tolerance = 1e-14 +tolerance = 1e-9 print("energy_start expected = " + str(energy_start)) print("energy_start_diags = " + str(energy_start_diags)) print("relative error = " + str(error)) diff --git a/Examples/Tests/rigid_injection/analysis_rigid_injection_lab.py b/Examples/Tests/rigid_injection/analysis_rigid_injection_lab.py index 69fbe4cc537..2f5661d9319 100755 --- a/Examples/Tests/rigid_injection/analysis_rigid_injection_lab.py +++ b/Examples/Tests/rigid_injection/analysis_rigid_injection_lab.py @@ -96,5 +96,7 @@ def remove_rigid_lines(plotfile, nlines_if_rigid): z = ad_start["beam", "particle_position_y"] orig_z = ad_start["beam", "particle_orig_z"] center = ad_start["beam", "particle_center"] -assert np.array_equal(z, orig_z) +print(z) +print(orig_z) +assert np.isclose(z, orig_z, rtol=1e-15, atol=1e-15).all() assert np.array_equal(1 * (np.abs(x) < 5.0e-7), center) diff --git a/Regression/requirements.txt b/Regression/requirements.txt index 509123899ba..1c502efa390 100644 --- a/Regression/requirements.txt +++ b/Regression/requirements.txt @@ -1,7 +1,7 @@ -r ../requirements.txt dill lasy>=0.5.0 -matplotlib +matplotlib>=3.10.0 mpi4py numpy openpmd-api