diff options
author | 2019-04-18 11:26:51 -0700 | |
---|---|---|
committer | 2019-04-18 11:26:51 -0700 | |
commit | 5ed1a16ace5ed9d32e18e25b23ef87996679b4dc (patch) | |
tree | 110be73bd454bf2a673e2aa73b26b16cea29865c /Python/pywarpx/Constants.py | |
parent | be0cbe26c1914f14e059be84b546934a3933ab85 (diff) | |
parent | ae239587668bbadc742ce5992afc6d6f814c5a3c (diff) | |
download | WarpX-5ed1a16ace5ed9d32e18e25b23ef87996679b4dc.tar.gz WarpX-5ed1a16ace5ed9d32e18e25b23ef87996679b4dc.tar.zst WarpX-5ed1a16ace5ed9d32e18e25b23ef87996679b4dc.zip |
Merge branch 'dev' into RZgeometry
Diffstat (limited to 'Python/pywarpx/Constants.py')
-rw-r--r-- | Python/pywarpx/Constants.py | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/Python/pywarpx/Constants.py b/Python/pywarpx/Constants.py index eafddd72e..20107ebc4 100644 --- a/Python/pywarpx/Constants.py +++ b/Python/pywarpx/Constants.py @@ -3,30 +3,14 @@ from .Bucket import Bucket class Constants(Bucket): """ The purpose of this class is to be hold user defined constants - The constants will be concatenated into names and values string. """ def __init__(self): - Bucket.__init__(self, 'constants') + Bucket.__init__(self, 'my_constants') def __setattr__(self, name, value): # Make sure that any constants redefined have a consistent value if name in self.argvattrs: - assert self.argvattrs[name] == value, Exception('In consistent values given for user defined constants') + assert self.argvattrs[name] == value, Exception('An consistent values given for user defined constants') Bucket.__setattr__(self, name, value) - def attrlist(self): - "Concatenate the attributes into a string" - if self.argvattrs: - names = '' - values = '' - for attr, value in self.argvattrs.items(): - names += ' ' + attr - values += ' {}'.format(value) - return ['constants.use_my_constants = 1', - 'constants.constant_names = ' + names, - 'constants.constant_values = ' + values] - else: - return [] - - -constants = Constants() +my_constants = Constants() |