diff options
author | 2022-02-01 09:39:11 -0800 | |
---|---|---|
committer | 2022-02-01 09:39:11 -0800 | |
commit | 6cf7d7bb5c00700bda7fb1257cf1a466ef176d69 (patch) | |
tree | 5427afe6b76e8de2bcac08dd88e0ab529bdbc18a /Python | |
parent | 0f969159f21098db1843df0f797db874225ecd4c (diff) | |
download | WarpX-6cf7d7bb5c00700bda7fb1257cf1a466ef176d69.tar.gz WarpX-6cf7d7bb5c00700bda7fb1257cf1a466ef176d69.tar.zst WarpX-6cf7d7bb5c00700bda7fb1257cf1a466ef176d69.zip |
allow `add_particles` to be called with empty numpy arrays i.e. injecting zero particles (#2808)
Diffstat (limited to 'Python')
-rwxr-xr-x | Python/pywarpx/_libwarpx.py | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/Python/pywarpx/_libwarpx.py b/Python/pywarpx/_libwarpx.py index 8840ed37a..e6e0d0282 100755 --- a/Python/pywarpx/_libwarpx.py +++ b/Python/pywarpx/_libwarpx.py @@ -591,11 +591,6 @@ class LibWarpX(): for key, val in kwargs.items(): assert np.size(val)==1 or len(val)==maxlen, f"Length of {key} doesn't match len of others" - # --- If the length of the input is zero, then quietly return - # --- This is not an error - it just means that no particles are to be injected. - if maxlen == 0: - return - # --- Broadcast scalars into appropriate length arrays # --- If the parameter was not supplied, use the default value if lenx == 1: |