Skip to content

Commit 6cf7d7b

Browse files
allow add_particles to be called with empty numpy arrays i.e. injecting zero particles (#2808)
1 parent 0f96915 commit 6cf7d7b

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

Python/pywarpx/_libwarpx.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -591,11 +591,6 @@ def add_particles(self, species_name, x=None, y=None, z=None, ux=None, uy=None,
591591
for key, val in kwargs.items():
592592
assert np.size(val)==1 or len(val)==maxlen, f"Length of {key} doesn't match len of others"
593593

594-
# --- If the length of the input is zero, then quietly return
595-
# --- This is not an error - it just means that no particles are to be injected.
596-
if maxlen == 0:
597-
return
598-
599594
# --- Broadcast scalars into appropriate length arrays
600595
# --- If the parameter was not supplied, use the default value
601596
if lenx == 1:

0 commit comments

Comments
 (0)