diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2019-11-18 13:39:13 +0100 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2019-11-18 13:39:13 +0100 |
commit | 78bad4dc02aacd56ea7f579c67ce62815ac37025 (patch) | |
tree | ecf8ab922918b2af4e27c8d8b8459f6f7d08f510 /lib/dfatool.py | |
parent | 7c7e4b650c00e8a69da16b12ab301bcbcf01b1a8 (diff) |
dfatool: save preprocessing stats in cache
Diffstat (limited to 'lib/dfatool.py')
-rw-r--r-- | lib/dfatool.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/dfatool.py b/lib/dfatool.py index bd210be..d2837ef 100644 --- a/lib/dfatool.py +++ b/lib/dfatool.py @@ -577,7 +577,9 @@ class RawData: def load_cache(self): if os.path.exists(self.cache_file): with open(self.cache_file, 'r') as f: - self.traces = json.load(f) + cache_data = json.load(f) + self.traces = cache_data['traces'] + self.preprocessing_stats = cache_data['preprocessing_stats'] self.preprocessed = True def save_cache(self): @@ -586,7 +588,11 @@ class RawData: except FileExistsError: pass with open(self.cache_file, 'w') as f: - json.dump(self.traces, f) + cache_data = { + 'traces' : self.traces, + 'preprocessing_stats' : self.preprocessing_stats + } + json.dump(cache_data, f) def _state_is_too_short(self, online, offline, state_duration, next_transition): # We cannot control when an interrupt causes a state to be left |