Commit 278bcece authored by Domanski, Marian M.'s avatar Domanski, Marian M.
Browse files

Merge branch 'master' into 'master'

Results compatibility

See merge request !45
parents 68b27fcf f1d0a4b4
......@@ -251,15 +251,20 @@ class SimulationResults:
depth = depth[()]
# Reformat configuration to a dictionary from string
config_split = configuration.split(", '")
configuration = []
for pair in config_split:
pair = pair.replace('{', '')
pair = pair.replace('}', '')
pair = pair.replace('"', '')
pair = pair.replace("'", '')
configuration.append(pair.split(': '))
configuration = dict(configuration)
# Reformatting will change everything to strings, so except if there is
# an issue
try:
config_split = configuration.split(", '")
configuration = []
for pair in config_split:
pair = pair.replace('{', '')
pair = pair.replace('}', '')
pair = pair.replace('"', '')
pair = pair.replace("'", '')
configuration.append(pair.split(': '))
configuration = dict(configuration)
except BaseException:
configuration = {}
results = cls.__new__(cls)
results._positions = positions
......@@ -591,7 +596,7 @@ class SimulationResults:
# Check if sim_name exists in configuration, if not use current
# time
if not 'sim_name' in self._configuration.keys():
if 'sim_name' not in self._configuration.keys():
now = datetime.datetime.now()
date_string = now.strftime('%Y-%m-%d-%H-%M-%S')
self._configuration['sim_name'] = 'fluegg_' + date_string
......
Supports Markdown
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