diff options
Diffstat (limited to 'Python/pywarpx')
-rw-r--r-- | Python/pywarpx/Lasers.py | 7 | ||||
-rw-r--r-- | Python/pywarpx/Particles.py | 2 | ||||
-rw-r--r-- | Python/pywarpx/WarpX.py | 2 | ||||
-rw-r--r-- | Python/pywarpx/picmi.py | 5 |
4 files changed, 5 insertions, 11 deletions
diff --git a/Python/pywarpx/Lasers.py b/Python/pywarpx/Lasers.py index ba7303d35..b54156ba1 100644 --- a/Python/pywarpx/Lasers.py +++ b/Python/pywarpx/Lasers.py @@ -1,14 +1,11 @@ from .Bucket import Bucket -lasers = Bucket('lasers', nlasers=0, names=None) +lasers = Bucket('lasers', nlasers=0, names=[]) lasers_list = [] def newlaser(name): result = Bucket(name) lasers_list.append(result) lasers.nlasers += 1 - if lasers.names is None: - lasers.names = name - else: - lasers.names += ' ' + name + lasers.names.append(name) return result diff --git a/Python/pywarpx/Particles.py b/Python/pywarpx/Particles.py index 757a49d00..582e623b7 100644 --- a/Python/pywarpx/Particles.py +++ b/Python/pywarpx/Particles.py @@ -1,6 +1,6 @@ from .Bucket import Bucket -particles = Bucket('particles', nspecies=0, species_names=None) +particles = Bucket('particles', nspecies=0, species_names=[]) particles_list = [] electrons = Bucket('electrons') diff --git a/Python/pywarpx/WarpX.py b/Python/pywarpx/WarpX.py index 1b536a55c..2ef3d99c1 100644 --- a/Python/pywarpx/WarpX.py +++ b/Python/pywarpx/WarpX.py @@ -29,7 +29,7 @@ class WarpX(Bucket): # --- Search through species_names and add any predefined particle objects in the list. particles_list_names = [p.instancename for p in particles_list] - for pstring in particles.species_names.split(' '): + for pstring in particles.species_names: if pstring in particles_list_names: # --- The species is already included in particles_list continue diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index 28dde05e6..70f356475 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -63,10 +63,7 @@ class Species(picmistandard.PICMI_Species): if self.name is None: self.name = 'species{}'.format(self.species_number) - if pywarpx.particles.species_names is None: - pywarpx.particles.species_names = self.name - else: - pywarpx.particles.species_names += ' ' + self.name + pywarpx.particles.species_names.append(self.name) self.species = pywarpx.Bucket.Bucket(self.name, mass = self.mass, |