diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-03-15 16:54:28 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-03-15 16:54:28 +0100 |
commit | 862945aa0c6b9eaadd06662dd67bf80f3812b2ec (patch) | |
tree | 29ae9321c4769f6fa73e7b8d3a4ca2765a9e933d /bin/analyze-archive.py | |
parent | c00fb33e29548fab04b648b0dcef481f7d6bc58e (diff) |
allow inferred functions to be overridden manually
Diffstat (limited to 'bin/analyze-archive.py')
-rwxr-xr-x | bin/analyze-archive.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py index a9ef3bc..0882883 100755 --- a/bin/analyze-archive.py +++ b/bin/analyze-archive.py @@ -41,10 +41,11 @@ if __name__ == '__main__': ignored_trace_indexes = None discard_outliers = None + function_override = {} try: raw_opts, args = getopt.getopt(sys.argv[1:], "", - 'plot ignored-trace-indexes= discard-outliers='.split(' ')) + 'plot ignored-trace-indexes= discard-outliers= function-override='.split(' ')) for option, parameter in raw_opts: optname = re.sub(r'^--', '', option) @@ -58,6 +59,11 @@ if __name__ == '__main__': if 'discard-outliers' in opts: discard_outliers = float(opts['discard-outliers']) + if 'function-override' in opts: + for function_desc in opts['function-override'].split(';'): + state_or_tran, attribute, *function_str = function_desc.split(' ') + function_override[(state_or_tran, attribute)] = ' '.join(function_str) + except getopt.GetoptError as err: print(err) sys.exit(2) @@ -67,7 +73,8 @@ if __name__ == '__main__': preprocessed_data = raw_data.get_preprocessed_data() model = EnergyModel(preprocessed_data, ignore_trace_indexes = ignored_trace_indexes, - discard_outliers = discard_outliers) + discard_outliers = discard_outliers, + function_override = function_override) print('--- simple static model ---') static_model = model.get_static() |