diff options
author | 2018-07-25 14:38:15 -0700 | |
---|---|---|
committer | 2018-07-25 14:38:15 -0700 | |
commit | 9c9ab769bba7b6d92170bce2651a294c500c1260 (patch) | |
tree | 4589f4b39a979def3569168d8ace544f7d3f5295 /Python/pywarpx/WarpX.py | |
parent | 4e379e6c6e69fe499cd91be7c6019448f392ec14 (diff) | |
download | WarpX-9c9ab769bba7b6d92170bce2651a294c500c1260.tar.gz WarpX-9c9ab769bba7b6d92170bce2651a294c500c1260.tar.zst WarpX-9c9ab769bba7b6d92170bce2651a294c500c1260.zip |
Cleaned up handling of new species
Diffstat (limited to 'Python/pywarpx/WarpX.py')
-rw-r--r-- | Python/pywarpx/WarpX.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/pywarpx/WarpX.py b/Python/pywarpx/WarpX.py index 7a05c40fb..d7a37a6fa 100644 --- a/Python/pywarpx/WarpX.py +++ b/Python/pywarpx/WarpX.py @@ -29,10 +29,10 @@ class WarpX(Bucket): argv += particles.attrlist() argv += laser.attrlist() - if not particles_list: - # --- This is needed in case only species_names has been set, - # --- assuming that only the built in particle types are being used. - for pstring in particles.species_names.split(' '): + # --- Search through species_names and add any predefined particle objects in the list. + # --- assuming that only the built in particle types are being used. + for pstring in particles.species_names.split(' '): + if hasattr(Particles, pstring): particles_list.append(getattr(Particles, pstring)) for particle in particles_list: |