Skip to content

Commit

Permalink
Fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EZoni committed Aug 16, 2024
1 parent 942e9c0 commit 36c3d18
Show file tree
Hide file tree
Showing 18 changed files with 27 additions and 33 deletions.
6 changes: 3 additions & 3 deletions Examples/Tests/collision/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ add_warpx_test(
OFF # eb
Examples/Tests/collision/inputs_3d_test_collision_xyz # inputs
Examples/Tests/collision/analysis_collision_3d.py # analysis
collision_xyz_plt000150 # output
diags/diag1000150 # output
)

# collision_xz ################################################################
Expand All @@ -58,7 +58,7 @@ add_warpx_test(
OFF # eb
Examples/Tests/collision/inputs_2d_test_collision_xz # inputs
Examples/Tests/collision/analysis_collision_2d.py # analysis
collision_xz_plt000150 # output
diags/diag1000150 # output
)

# collision_xz_picmi ##########################################################
Expand All @@ -70,5 +70,5 @@ add_warpx_test(
OFF # eb
Examples/Tests/collision/inputs_2d_test_collision_xz_picmi.py # inputs
Examples/Tests/collision/analysis_collision_2d.py # analysis
collision_xz_plt000150 # output
diags/diag1000150 # output
)
10 changes: 8 additions & 2 deletions Examples/Tests/collision/analysis_collision_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
sys.path.insert(1, '../../../../warpx/Regression/Checksum/')
import checksumAPI

test_name = os.path.split(os.getcwd())[1]

tolerance = 0.001

ng = 64
Expand All @@ -61,6 +63,11 @@
# Collect all output files in fn_list (names match pattern prefix + arbitrary number)
fn_list = glob.glob(prefix + '*[0-9]')

print(last_fn)
print(last_it)
print(prefix)
print(fn_list)

error = 0.0
nt = 0
for fn in fn_list:
Expand All @@ -86,7 +93,7 @@

# The second part of the analysis is not done for the Python test
# since the particle filter function is not accessible from PICMI yet
if "Python" in last_fn:
if "picmi" in test_name:
exit()

## In the second part of the test, we verify that the diagnostic particle filter function works as
Expand All @@ -110,5 +117,4 @@
post_processing_utils.check_random_filter(last_fn, random_filter_fn, random_fraction,
dim, species_name)

test_name = os.path.split(os.getcwd())[1]
checksumAPI.evaluate_checksum(test_name, last_fn)
1 change: 0 additions & 1 deletion Examples/Tests/collision/inputs_2d_test_collision_xz
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ diagnostics.diags_names = diag1 diag_parser_filter diag_uniform_filter diag_rand
diag1.intervals = 10
diag1.diag_type = Full
diag1.fields_to_plot = Ex Ey Ez Bx By Bz
diag1.file_prefix = collisionXZ_plt

## diag_parser_filter is a diag used to test the particle filter function.
diag_parser_filter.intervals = 150:150:
Expand Down
4 changes: 0 additions & 4 deletions Examples/Tests/collision/inputs_2d_test_collision_xz_picmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,12 @@
particle_diag = picmi.ParticleDiagnostic(
name='diag1',
period=10,
write_dir='.',
warpx_file_prefix='collision_xz_picmi_plt'
)
field_diag = picmi.FieldDiagnostic(
name='diag1',
grid=grid,
period=10,
data_list=[],
write_dir='.',
warpx_file_prefix='collision_xz_picmi_plt'
)

#################################
Expand Down
1 change: 0 additions & 1 deletion Examples/Tests/collision/inputs_3d_test_collision_xyz
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ diagnostics.diags_names = diag1 diag_parser_filter diag_uniform_filter diag_rand
diag1.intervals = 10
diag1.diag_type = Full
diag1.fields_to_plot = Ex Ey Ez Bx By Bz T_electron T_ion
diag1.file_prefix = collisionXYZ_plt

## diag_parser_filter is a diag used to test the particle filter function.
diag_parser_filter.intervals = 150:150:
Expand Down
4 changes: 1 addition & 3 deletions Examples/Tests/electrostatic_dirichlet_bc/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
import numpy as np
import yt

files = sorted(glob.glob('dirichletbc_plt*'))[1:]
if len(files) == 0:
files = sorted(glob.glob('Python_dirichletbc_plt*'))[1:]
files = sorted(glob.glob('diags/diag1*'))[1:]
assert len(files) > 0

times = np.ones(len(files))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
max_step = 100
warpx.verbose = 0
warpx.abort_on_warning_threshold = medium
warpx.const_dt = 7.5e-10
warpx.do_electrostatic = labframe
warpx.self_fields_required_precision = 1e-06
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,12 @@
particle_diag = picmi.ParticleDiagnostic(
name = 'diag1',
period = 4,
write_dir = '.',
warpx_file_prefix = 'Python_dirichletbc_plt'
)
field_diag = picmi.FieldDiagnostic(
name = 'diag1',
grid = grid,
period = 4,
data_list = ['phi'],
write_dir = '.',
warpx_file_prefix = 'Python_dirichletbc_plt'
)

##########################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ my_constants.dt = 0.1/wpe # time step size, s

max_step = 100
amr.n_cell = nz
amr.max_grid_size = 32
amr.max_level = 0

geometry.dims = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ my_constants.dt = 0.1/wpe # time step size, s

max_step = 100
amr.n_cell = nz
amr.max_grid_size = 32
amr.max_level = 0

geometry.dims = 1
Expand Down
19 changes: 10 additions & 9 deletions Examples/Tests/pass_mpi_communicator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Add tests (alphabetical order) ##############################################
#

# FIXME
# pass_mpi_comm_picmi #########################################################
#
add_warpx_test(
pass_mpi_comm_picmi # name
2 # dims
2 # nprocs
OFF # eb
Examples/Tests/pass_mpi_communicator/inputs_2d_test_pass_mpi_comm_picmi.py # inputs
Examples/Tests/pass_mpi_communicator/analysis.py # analysis
diags/diag1000010 # output
)
#add_warpx_test(
# pass_mpi_comm_picmi # name
# 2 # dims
# 2 # nprocs
# OFF # eb
# Examples/Tests/pass_mpi_communicator/inputs_2d_test_pass_mpi_comm_picmi.py # inputs
# Examples/Tests/pass_mpi_communicator/analysis.py # analysis
# diags/diag1000010 # output
#)
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,10 @@
diag_field_list = ["E", "B"]
particle_diag = picmi.ParticleDiagnostic(name = 'diag1',
period = 10,
write_dir = '.',
warpx_file_prefix = 'Python_wrappers_plt',
data_list = diag_field_list)
field_diag = picmi.FieldDiagnostic(name = 'diag1',
grid = grid,
period = 10,
write_dir = '.',
warpx_file_prefix = 'Python_wrappers_plt',
data_list = diag_field_list)

# Initialize simulation
Expand Down
4 changes: 2 additions & 2 deletions Examples/Tests/resampling/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ add_warpx_test(
1 # dims
2 # nprocs
OFF # eb
Examples/Tests/resampling/inputs_2d_test_resample_velocity_coincidence_thinning # inputs
Examples/Tests/resampling/inputs_1d_test_resample_velocity_coincidence_thinning # inputs
Examples/analysis_default_regression.py # analysis
diags/diag1000004 # output
)
Expand All @@ -32,7 +32,7 @@ add_warpx_test(
1 # dims
2 # nprocs
OFF # eb
Examples/Tests/resampling/inputs_2d_test_resample_velocity_coincidence_thinning_cartesian # inputs
Examples/Tests/resampling/inputs_1d_test_resample_velocity_coincidence_thinning_cartesian # inputs
Examples/analysis_default_regression.py # analysis
diags/diag1000004 # output
)

0 comments on commit 36c3d18

Please sign in to comment.