diff options
author | 2020-09-17 17:13:41 -0700 | |
---|---|---|
committer | 2020-09-17 17:13:41 -0700 | |
commit | ad0603af7789111003c7bcb9f29bd6745ddbff0a (patch) | |
tree | 24e2fb2154537daa77a622956c983807a5fe64b0 /Python/pywarpx/Bucket.py | |
parent | 6243b97603d423dd9fe9c227efbfb71dafe949ca (diff) | |
download | WarpX-ad0603af7789111003c7bcb9f29bd6745ddbff0a.tar.gz WarpX-ad0603af7789111003c7bcb9f29bd6745ddbff0a.tar.zst WarpX-ad0603af7789111003c7bcb9f29bd6745ddbff0a.zip |
[Mini]picmi - convert True/False to 1/0 (#1341)
* picmi - convert True/False to 1/0
* picmi - update picmi input files to use True/False for booleans
Diffstat (limited to 'Python/pywarpx/Bucket.py')
-rw-r--r-- | Python/pywarpx/Bucket.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/pywarpx/Bucket.py b/Python/pywarpx/Bucket.py index 7817f8f86..61276c75a 100644 --- a/Python/pywarpx/Bucket.py +++ b/Python/pywarpx/Bucket.py @@ -60,6 +60,8 @@ class Bucket(object): # --- For lists, tuples, and arrays make a space delimited string of the values. # --- The lambda is needed in case this is a list of strings. rhs = ' '.join(map(lambda s : repr(s).strip("'\""), value)) + elif isinstance(value, bool): + rhs = 1 if value else 0 else: rhs = value attrstring = '{0}.{1} = {2}'.format(self.instancename, attr, repr(rhs).strip("'\"")) |