Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EZoni committed Nov 12, 2024
1 parent 6cd93a0 commit 837c99f
Show file tree
Hide file tree
Showing 30 changed files with 90 additions and 187 deletions.
32 changes: 16 additions & 16 deletions Examples/Physics_applications/plasma_acceleration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ add_warpx_test(
1 # dims
2 # nprocs
inputs_test_1d_plasma_acceleration_picmi.py # inputs
analysis_default_regression.py # analysis
diags/diag1001000 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1001000 --plotfile" # checksum
OFF # dependency
)

Expand All @@ -16,8 +16,8 @@ add_warpx_test(
2 # dims
2 # nprocs
inputs_test_2d_plasma_acceleration_boosted # inputs
analysis_default_regression.py # analysis
diags/diag1000020 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1000020 --plotfile" # checksum
OFF # dependency
)

Expand All @@ -26,8 +26,8 @@ add_warpx_test(
2 # dims
2 # nprocs
inputs_test_2d_plasma_acceleration_mr # inputs
analysis_default_regression.py # analysis
diags/diag1000400 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1000400 --plotfile" # checksum
OFF # dependency
)

Expand All @@ -36,8 +36,8 @@ add_warpx_test(
2 # dims
2 # nprocs
inputs_test_2d_plasma_acceleration_mr_momentum_conserving # inputs
analysis_default_regression.py # analysis
diags/diag1000400 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1000400 --plotfile" # checksum
OFF # dependency
)

Expand All @@ -46,8 +46,8 @@ add_warpx_test(
3 # dims
2 # nprocs
inputs_test_3d_plasma_acceleration_boosted # inputs
analysis_default_regression.py # analysis
diags/diag1000005 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1000005 --plotfile" # checksum
OFF # dependency
)

Expand All @@ -56,8 +56,8 @@ add_warpx_test(
3 # dims
2 # nprocs
inputs_test_3d_plasma_acceleration_boosted_hybrid # inputs
analysis_default_regression.py # analysis
diags/diag1000025 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1000025 --plotfile" # checksum
OFF # dependency
)

Expand All @@ -66,8 +66,8 @@ add_warpx_test(
3 # dims
2 # nprocs
inputs_test_3d_plasma_acceleration_mr_picmi.py # inputs
analysis_default_regression.py # analysis
diags/diag1000002 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1000002 --plotfile" # checksum
OFF # dependency
)

Expand All @@ -76,7 +76,7 @@ add_warpx_test(
3 # dims
2 # nprocs
inputs_test_3d_plasma_acceleration_picmi.py # inputs
analysis_default_regression.py # analysis
diags/diag1000010 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1000010 --plotfile" # checksum
OFF # dependency
)
4 changes: 2 additions & 2 deletions Examples/Physics_applications/plasma_mirror/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ add_warpx_test(
2 # dims
2 # nprocs
inputs_test_2d_plasma_mirror # inputs
analysis_default_regression.py # analysis
diags/diag1000020 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1000020 --plotfile" # checksum
OFF # dependency
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ add_warpx_test(
RZ # dims
2 # nprocs
inputs_test_rz_spacecraft_charging_picmi.py # inputs
analysis.py # analysis
diags/diag1/ # output
"analysis.py diags/diag1/" # analysis
"analysis_default_regression.py --path diags/diag1/ --openpmd" # checksum
OFF # dependency
)
endif()
10 changes: 0 additions & 10 deletions Examples/Physics_applications/spacecraft_charging/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
by the following exponential function: phi(t)=v0(1-exp(-t/tau))
"""

import os
import sys

import matplotlib.pyplot as plt
Expand All @@ -22,8 +21,6 @@
from scipy.optimize import curve_fit

yt.funcs.mylog.setLevel(0)
sys.path.insert(1, "../../../../warpx/Regression/Checksum/")
from checksumAPI import evaluate_checksum

filename = sys.argv[1]
ts = OpenPMDTimeSeries(filename)
Expand Down Expand Up @@ -74,10 +71,3 @@ def func(x, v0, tau):
assert (diff_v0 < tolerance_v0) and (
diff_tau < tolerance_tau
), "Test spacecraft_charging did not pass"

# compare checksums
evaluate_checksum(
test_name=os.path.split(os.getcwd())[1],
output_file=sys.argv[1],
output_format="openpmd",
)
12 changes: 6 additions & 6 deletions Examples/Physics_applications/uniform_plasma/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ add_warpx_test(
2 # dims
2 # nprocs
inputs_test_2d_uniform_plasma # inputs
analysis_default_regression.py # analysis
diags/diag1000010 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1000010 --plotfile" # checksum
OFF # dependency
)

Expand All @@ -16,8 +16,8 @@ add_warpx_test(
3 # dims
2 # nprocs
inputs_test_3d_uniform_plasma # inputs
analysis_default_regression.py # analysis
diags/diag1000010 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1000010 --plotfile" # checksum
OFF # dependency
)

Expand All @@ -26,7 +26,7 @@ add_warpx_test(
3 # dims
2 # nprocs
inputs_test_3d_uniform_plasma_restart # inputs
analysis_default_restart.py # analysis
diags/diag1000010 # output
"analysis_default_restart.py diags/diag1000010" # analysis
"analysis_default_regression.py --path diags/diag1000010 --plotfile --rtol 1e-12" # checksum
test_3d_uniform_plasma # dependency
)
36 changes: 18 additions & 18 deletions Examples/Tests/restart/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ add_warpx_test(
2 # dims
1 # nprocs
inputs_test_2d_id_cpu_read_picmi.py # inputs
analysis_default_regression.py # analysis
diags/diag1000010 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1000010 --plotfile" # checksum
OFF # dependency
)

Expand All @@ -16,8 +16,8 @@ add_warpx_test(
2 # dims
1 # nprocs
inputs_test_2d_runtime_components_picmi.py # inputs
analysis_default_regression.py # analysis
diags/diag1000010 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1000010 --plotfile" # checksum
OFF # dependency
)

Expand All @@ -27,8 +27,8 @@ add_warpx_test(
2 # dims
1 # nprocs
"inputs_test_2d_runtime_components_picmi.py amr.restart='../test_2d_runtime_components_picmi/diags/chk000005'" # inputs
OFF #analysis_default_restart.py # analysis
OFF #diags/diag1000010 # output
"analysis_default_restart.py diags/diag1000010" # analysis
"analysis_default_regression.py --path diags/diag1000010 --plotfile" # checksum
test_2d_runtime_components_picmi # dependency
)

Expand All @@ -37,8 +37,8 @@ add_warpx_test(
3 # dims
2 # nprocs
inputs_test_3d_acceleration # inputs
analysis_default_regression.py # analysis
diags/diag1000010 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1000010 --plotfile" # checksum
OFF # dependency
)

Expand All @@ -47,8 +47,8 @@ add_warpx_test(
3 # dims
2 # nprocs
inputs_test_3d_acceleration_restart # inputs
analysis_default_restart.py # analysis
diags/diag1000010 # output
"analysis_default_restart.py diags/diag1000010" # analysis
"analysis_default_regression.py --path diags/diag1000010 --plotfile" # checksum
test_3d_acceleration # dependency
)

Expand All @@ -58,8 +58,8 @@ if(WarpX_FFT)
3 # dims
2 # nprocs
inputs_test_3d_acceleration_psatd # inputs
analysis_default_regression.py # analysis
diags/diag1000010 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1000010 --plotfile" # checksum
OFF # dependency
)
endif()
Expand All @@ -70,8 +70,8 @@ if(WarpX_FFT)
3 # dims
2 # nprocs
inputs_test_3d_acceleration_psatd_restart # inputs
analysis_default_restart.py # analysis
diags/diag1000010 # output
"analysis_default_restart.py diags/diag1000010" # analysis
"analysis_default_regression.py --path diags/diag1000010 --plotfile" # checksum
test_3d_acceleration_psatd # dependency
)
endif()
Expand All @@ -82,8 +82,8 @@ if(WarpX_FFT)
3 # dims
2 # nprocs
inputs_test_3d_acceleration_psatd_time_avg # inputs
analysis_default_regression.py # analysis
diags/diag1000010 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1000010 --plotfile" # checksum
OFF # dependency
)
endif()
Expand All @@ -94,8 +94,8 @@ if(WarpX_FFT)
3 # dims
2 # nprocs
inputs_test_3d_acceleration_psatd_time_avg_restart # inputs
analysis_default_restart.py # analysis
diags/diag1000010 # output
"analysis_default_restart.py diags/diag1000010" # analysis
"analysis_default_regression.py --path diags/diag1000010 --plotfile" # checksum
test_3d_acceleration_psatd_time_avg # dependency
)
endif()
21 changes: 0 additions & 21 deletions Examples/Tests/restart/analysis_restart.py

This file was deleted.

8 changes: 4 additions & 4 deletions Examples/Tests/rigid_injection/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ add_warpx_test(
2 # dims
2 # nprocs
inputs_test_2d_rigid_injection_btd # inputs
analysis_rigid_injection_btd.py # analysis
diags/diag1000001 # output
"analysis_rigid_injection_btd.py diags/diag1000001" # analysis
"analysis_default_regression.py --path diags/diag1000001 --plotfile" # checksum
OFF # dependency
)

Expand All @@ -16,7 +16,7 @@ add_warpx_test(
2 # dims
2 # nprocs
inputs_test_2d_rigid_injection_lab # inputs
analysis_rigid_injection_lab.py # analysis
diags/diag1000289 # output
"analysis_rigid_injection_lab.py diags/diag1000289" # analysis
"analysis_default_regression.py --path diags/diag1000289 --plotfile" # checksum
OFF # dependency
)
10 changes: 0 additions & 10 deletions Examples/Tests/rigid_injection/analysis_rigid_injection_btd.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
frame, i.e., on the back-transformed diagnostics.
"""

import os
import sys

import numpy as np
Expand All @@ -29,9 +28,6 @@

yt.funcs.mylog.setLevel(0)

sys.path.insert(1, "../../../../warpx/Regression/Checksum/")
from checksumAPI import evaluate_checksum

filename = sys.argv[1]

# Tolerances to check consistency between plotfile BTD and openPMD BTD
Expand Down Expand Up @@ -80,9 +76,3 @@
print(f"error = {err}")
print(f"tolerance = {tol}")
assert err < tol

# compare checksums
evaluate_checksum(
test_name=os.path.split(os.getcwd())[1],
output_file=sys.argv[1],
)
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@
with the gaussian_beam injection style.
"""

import os
import sys

import numpy as np
import yt

yt.funcs.mylog.setLevel(0)
sys.path.insert(1, "../../../../warpx/Regression/Checksum/")
from checksumAPI import evaluate_checksum

filename = sys.argv[1]

Expand Down Expand Up @@ -101,9 +98,3 @@ def remove_rigid_lines(plotfile, nlines_if_rigid):
center = ad_start["beam", "particle_center"]
assert np.array_equal(z, orig_z)
assert np.array_equal(1 * (np.abs(x) < 5.0e-7), center)

# compare checksums
evaluate_checksum(
test_name=os.path.split(os.getcwd())[1],
output_file=sys.argv[1],
)
8 changes: 4 additions & 4 deletions Examples/Tests/scraping/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ if(WarpX_EB)
RZ # dims
2 # nprocs
inputs_test_rz_scraping # inputs
analysis_rz.py # analysis
diags/diag1000037 # output
"analysis_rz.py diags/diag1000037" # analysis
"analysis_default_regression.py --path diags/diag1000037 --plotfile --skip-particles" # checksum
OFF # dependency
)
endif()
Expand All @@ -19,8 +19,8 @@ if(WarpX_EB)
RZ # dims
2 # nprocs
inputs_test_rz_scraping_filter # inputs
analysis_rz_filter.py # analysis
diags/diag1000037 # output
"analysis_rz_filter.py diags/diag1000037" # analysis
OFF # checksum
OFF # dependency
)
endif()
1 change: 1 addition & 0 deletions Examples/Tests/scraping/analysis_default_regression.py
Loading

0 comments on commit 837c99f

Please sign in to comment.