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 3b09aef commit 5dd42d7
Show file tree
Hide file tree
Showing 23 changed files with 66 additions and 181 deletions.
20 changes: 10 additions & 10 deletions Examples/Tests/plasma_lens/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ add_warpx_test(
3 # dims
2 # nprocs
inputs_test_3d_plasma_lens # inputs
analysis.py # analysis
diags/diag1000084 # output
"analysis.py diags/diag1000084" # analysis
"analysis_default_regression.py --path diags/diag1000084 --plotfile" # checksum
OFF # dependency
)

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

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

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

Expand All @@ -46,7 +46,7 @@ add_warpx_test(
3 # dims
2 # nprocs
inputs_test_3d_plasma_lens_short # inputs
analysis.py # analysis
diags/diag1000084 # output
"analysis.py diags/diag1000084" # analysis
"analysis_default_regression.py --path diags/diag1000084 --plotfile" # checksum
OFF # dependency
)
12 changes: 0 additions & 12 deletions Examples/Tests/plasma_lens/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,13 @@
The motion is slow enough that relativistic effects are ignored.
"""

import os
import re
import sys

import numpy as np
import yt
from scipy.constants import c, e, m_e

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

filename = sys.argv[1]
ds = yt.load(filename)
Expand Down Expand Up @@ -194,11 +190,3 @@ def applylens(x0, vx0, vz0, gamma, lens_length, lens_strength):
assert abs(np.abs((uy - uy_sim) / uy)) < velocity_tolerance, Exception(
"error in y particle velocity"
)

# compare checksums
test_name = os.path.split(os.getcwd())[1]
test_name = re.sub("_picmi", "", test_name) # same checksums for PICMI test
evaluate_checksum(
test_name=test_name,
output_file=sys.argv[1],
)
1 change: 1 addition & 0 deletions Examples/Tests/plasma_lens/analysis_default_regression.py
32 changes: 16 additions & 16 deletions Examples/Tests/pml/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_pml_x_ckc # inputs
analysis_pml_ckc.py # analysis
diags/diag1000300 # output
"analysis_pml_ckc.py diags/diag1000300" # analysis
"analysis_default_regression.py --path diags/diag1000300 --plotfile" # checksum
OFF # dependency
)

Expand All @@ -17,8 +17,8 @@ if(WarpX_FFT)
2 # dims
2 # nprocs
inputs_test_2d_pml_x_galilean # inputs
analysis_pml_psatd.py # analysis
diags/diag1000300 # output
"analysis_pml_psatd.py diags/diag1000300" # analysis
"analysis_default_regression.py --path diags/diag1000300 --plotfile" # checksum
OFF # dependency
)
endif()
Expand All @@ -29,8 +29,8 @@ if(WarpX_FFT)
2 # dims
2 # nprocs
inputs_test_2d_pml_x_psatd # inputs
analysis_pml_psatd.py # analysis
diags/diag1000300 # output
"analysis_pml_psatd.py diags/diag1000300" # analysis
"analysis_default_regression.py --path diags/diag1000300 --plotfile" # checksum
OFF # dependency
)
endif()
Expand All @@ -41,8 +41,8 @@ if(WarpX_FFT)
2 # dims
2 # nprocs
inputs_test_2d_pml_x_psatd_restart # inputs
analysis_default_restart.py # analysis
diags/diag1000300 # output
"analysis_default_restart.py diags/diag1000300" # analysis
"analysis_default_regression.py --path diags/diag1000300 --plotfile" # checksum
test_2d_pml_x_psatd # dependency
)
endif()
Expand All @@ -52,8 +52,8 @@ add_warpx_test(
2 # dims
2 # nprocs
inputs_test_2d_pml_x_yee # inputs
analysis_pml_yee.py # analysis
diags/diag1000300 # output
"analysis_pml_yee.py diags/diag1000300" # analysis
"analysis_default_regression.py --path diags/diag1000300 --plotfile" # checksum
OFF # dependency
)

Expand All @@ -62,8 +62,8 @@ add_warpx_test(
2 # dims
2 # nprocs
inputs_test_2d_pml_x_yee_restart # inputs
analysis_default_restart.py # analysis
diags/diag1000300 # output
"analysis_default_restart.py diags/diag1000300" # analysis
"analysis_default_regression.py --path diags/diag1000300 --plotfile" # checksum
test_2d_pml_x_yee # dependency
)

Expand All @@ -73,8 +73,8 @@ if(WarpX_FFT)
3 # dims
2 # nprocs
inputs_test_3d_pml_psatd_dive_divb_cleaning # inputs
analysis_default_regression.py # analysis
diags/diag1000100 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1000100 --plotfile" # checksum
OFF # dependency
)
endif()
Expand All @@ -85,8 +85,8 @@ if(WarpX_FFT)
RZ # dims
2 # nprocs
inputs_test_rz_pml_psatd # inputs
analysis_pml_psatd_rz.py # analysis
diags/diag1000500 # output
"analysis_pml_psatd_rz.py diags/diag1000500" # analysis
"analysis_default_regression.py --path diags/diag1000500 --plotfile" # checksum
OFF # dependency
)
endif()
9 changes: 0 additions & 9 deletions Examples/Tests/pml/analysis_pml_ckc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@
# License: BSD-3-Clause-LBNL


import os
import sys

import numpy as np
import scipy.constants as scc
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 @@ -56,9 +53,3 @@
print("tolerance_rel: " + str(tolerance_rel))

assert error_rel < tolerance_rel

# compare checksums
evaluate_checksum(
test_name=os.path.split(os.getcwd())[1],
output_file=sys.argv[1],
)
8 changes: 0 additions & 8 deletions Examples/Tests/pml/analysis_pml_psatd.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
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 @@ -74,9 +72,3 @@
print("reflectivity_max = " + str(reflectivity_max))

assert reflectivity < reflectivity_max

# compare checksums
evaluate_checksum(
test_name=os.path.split(os.getcwd())[1],
output_file=sys.argv[1],
)
9 changes: 0 additions & 9 deletions Examples/Tests/pml/analysis_pml_psatd_rz.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@
the pulse will remain with in the domain.
"""

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

# Open plotfile specified in command line
filename = sys.argv[1]
Expand Down Expand Up @@ -54,9 +51,3 @@
tolerance_abs = 2.0
print("tolerance_abs: " + str(tolerance_abs))
assert max_Efield < tolerance_abs

# compare checksums
evaluate_checksum(
test_name=os.path.split(os.getcwd())[1],
output_file=sys.argv[1],
)
9 changes: 0 additions & 9 deletions Examples/Tests/pml/analysis_pml_yee.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@
# License: BSD-3-Clause-LBNL


import os
import sys

import numpy as np
import scipy.constants as scc
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 @@ -56,9 +53,3 @@
print("tolerance_rel: " + str(tolerance_rel))

assert error_rel < tolerance_rel

# 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/point_of_contact_eb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ if(WarpX_EB)
3 # dims
2 # nprocs
inputs_test_3d_point_of_contact_eb # inputs
analysis.py # analysis
diags/diag1/ # output
"analysis.py" # analysis
"analysis_default_regression.py --path diags/diag1/ --openpmd" # checksum
OFF # dependency
)
endif()
Expand All @@ -19,8 +19,8 @@ if(WarpX_EB)
RZ # dims
2 # nprocs
inputs_test_rz_point_of_contact_eb # inputs
analysis.py # analysis
diags/diag1/ # output
"analysis.py" # analysis
"analysis_default_regression.py --path diags/diag1/ --openpmd" # checksum
OFF # dependency
)
endif()
12 changes: 0 additions & 12 deletions Examples/Tests/point_of_contact_eb/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,11 @@
An input file inputs_test_3d_point_of_contact_eb is used.
"""

import os
import sys

import numpy as np
import yt
from openpmd_viewer import OpenPMDTimeSeries

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

ts_scraping = OpenPMDTimeSeries("./diags/diag2/particles_at_eb/")

Expand Down Expand Up @@ -92,10 +87,3 @@
and (diff_ny < tolerance_n)
and (np.abs(nz) < 1e-8)
), "Test point_of_contact 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/Tests/projection_divb_cleaner/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ add_warpx_test(
3 # dims
1 # nprocs
inputs_test_3d_projection_divb_cleaner_callback_picmi.py # inputs
analysis_default_regression.py # analysis
diags/diag1000001 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1000001 --plotfile" # checksum
OFF # dependency
)

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

Expand All @@ -26,7 +26,7 @@ add_warpx_test(
RZ # dims
1 # nprocs
inputs_test_rz_projection_divb_cleaner # inputs
analysis.py # analysis
diags/diag1000001 # output
"analysis.py diags/diag1000001" # analysis
"analysis_default_regression.py --path diags/diag1000001 --plotfile" # checksum
OFF # dependency
)
10 changes: 0 additions & 10 deletions Examples/Tests/projection_divb_cleaner/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,11 @@
# tolerance: 1.0e-8
# Possible running time: 0.327827743 s

import os
import sys

import numpy as np
import yt

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

tolerance = 4e-3

filename = sys.argv[1]
Expand Down Expand Up @@ -72,9 +68,3 @@
print("error = ", error)
print("tolerance = ", tolerance)
assert error < tolerance

# compare checksums
evaluate_checksum(
test_name=os.path.split(os.getcwd())[1],
output_file=sys.argv[1],
)
4 changes: 2 additions & 2 deletions Examples/Tests/python_wrappers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ if(WarpX_FFT)
2 # dims
2 # nprocs
inputs_test_2d_python_wrappers_picmi.py # inputs
analysis_default_regression.py # analysis
diags/diag1000100 # output
OFF # analysis
"analysis_default_regression.py --path diags/diag1000100 --plotfile" # checksum
OFF # dependency
)
endif()
Loading

0 comments on commit 5dd42d7

Please sign in to comment.