aboutsummaryrefslogtreecommitdiff
path: root/Examples/Tests/ParticleDataPython/PICMI_inputs_prev_pos_2d.py
diff options
context:
space:
mode:
authorGravatar David Grote <grote1@llnl.gov> 2021-12-16 10:12:57 -0800
committerGravatar GitHub <noreply@github.com> 2021-12-16 10:12:57 -0800
commit746ddc2ae871e70cd50940c2cca03a17a9b7ec1a (patch)
tree37ba15e42ada9f89378894156214ab7b05699e66 /Examples/Tests/ParticleDataPython/PICMI_inputs_prev_pos_2d.py
parentb0b03f6bc5e7768c4ecbcb4e4a2c505d9e4aad91 (diff)
downloadWarpX-746ddc2ae871e70cd50940c2cca03a17a9b7ec1a.tar.gz
WarpX-746ddc2ae871e70cd50940c2cca03a17a9b7ec1a.tar.zst
WarpX-746ddc2ae871e70cd50940c2cca03a17a9b7ec1a.zip
Wrap shared object in a class to control its loading (#2637)
* Wrap shared object in a class to control its loading * Fix libwarpx attribute references * Updated callbacks.py for updated libwarpx * Removed the wx module plus other clean up * Further revision of how to use the pywarpx module. Now, _libwarpx should not be imported by external scripts except in special circumstances. * Updated documentation * Clean up end of line whitespace * Added more wrapping routines plus some clean up * Fixed use of pywarpx in two examples * Fix for getistep * Fixed for the EB Python interface * Silence a warning for our wrapper Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Diffstat (limited to 'Examples/Tests/ParticleDataPython/PICMI_inputs_prev_pos_2d.py')
-rwxr-xr-xExamples/Tests/ParticleDataPython/PICMI_inputs_prev_pos_2d.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/Examples/Tests/ParticleDataPython/PICMI_inputs_prev_pos_2d.py b/Examples/Tests/ParticleDataPython/PICMI_inputs_prev_pos_2d.py
index d8e37140f..d71aa3fea 100755
--- a/Examples/Tests/ParticleDataPython/PICMI_inputs_prev_pos_2d.py
+++ b/Examples/Tests/ParticleDataPython/PICMI_inputs_prev_pos_2d.py
@@ -3,6 +3,7 @@
# --- Input file to test the saving of old particle positions
import numpy as np
+import pywarpx
from pywarpx import picmi
constants = picmi.constants
@@ -109,12 +110,10 @@ sim.step(max_steps - 1)
# exist
##########################
-from pywarpx import _libwarpx
+assert (pywarpx.get_particle_comp_index('electrons', 'prev_x') > 0)
+assert (pywarpx.get_particle_comp_index('electrons', 'prev_z') > 0)
-assert (_libwarpx.get_particle_comp_index('electrons', 'prev_x') > 0)
-assert (_libwarpx.get_particle_comp_index('electrons', 'prev_z') > 0)
-
-prev_z_vals = _libwarpx.get_particle_arrays(
+prev_z_vals = pywarpx.get_particle_arrays(
'electrons', 'prev_z', 0
)
for z_vals in prev_z_vals: