From ad0603af7789111003c7bcb9f29bd6745ddbff0a Mon Sep 17 00:00:00 2001 From: David Grote Date: Thu, 17 Sep 2020 17:13:41 -0700 Subject: [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 --- Python/pywarpx/Bucket.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Python/pywarpx/Bucket.py') 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("'\"")) -- cgit v1.2.3