Commit 0feea3bb authored by Markus Scheidgen's avatar Markus Scheidgen

Reset the context to reuse over multiple runs.

parent 68b89cde
...@@ -130,9 +130,11 @@ H 1 # Species label, number of l-shells ...@@ -130,9 +130,11 @@ H 1 # Species label, number of l-shells
""" """
class SiestaContext(object): class SiestaContext(object):
def __init__(self): def __init__(self):
self.reset()
def reset(self):
self.fname = None # The file that we are parsing self.fname = None # The file that we are parsing
self.dirname = None # Base directory of calculations self.dirname = None # Base directory of calculations
#self.parser = None # The parser object #self.parser = None # The parser object
...@@ -671,6 +673,7 @@ class SiestaParser(): ...@@ -671,6 +673,7 @@ class SiestaParser():
logging.info('siesta parser started') logging.info('siesta parser started')
logging.getLogger('nomadcore').setLevel(logging.WARNING) logging.getLogger('nomadcore').setLevel(logging.WARNING)
backend = self.backend_factory(metaInfoEnv) backend = self.backend_factory(metaInfoEnv)
context.reset()
with patch.object(sys, 'argv', ['<exe>', '--uri', 'nmd://uri', mainfile]): with patch.object(sys, 'argv', ['<exe>', '--uri', 'nmd://uri', mainfile]):
mainFunction( mainFunction(
mainFileDescription, mainFileDescription,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment