diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/analyze-archive.py | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py index 9a8c416..88cfd62 100755 --- a/bin/analyze-archive.py +++ b/bin/analyze-archive.py @@ -4,7 +4,8 @@ import getopt import plotter import re import sys -from dfatool import EnergyModel, RawData, soft_cast_int +from dfatool import EnergyModel, RawData +from dfatool import soft_cast_int, is_numeric, gplearn_to_function opts = {} @@ -62,8 +63,11 @@ if __name__ == '__main__': function_override = {} try: - raw_opts, args = getopt.getopt(sys.argv[1:], "", - 'plot ignored-trace-indexes= discard-outliers= function-override= tex-output'.split(' ')) + optspec = ( + 'plot-unparam= plot-param= ' + 'ignored-trace-indexes= discard-outliers= function-override= tex-output' + ) + raw_opts, args = getopt.getopt(sys.argv[1:], "", optspec.split(' ')) for option, parameter in raw_opts: optname = re.sub(r'^--', '', option) @@ -97,6 +101,12 @@ if __name__ == '__main__': discard_outliers = discard_outliers, function_override = function_override) + + if 'plot-unparam' in opts: + for kv in opts['plot-unparam'].split(';'): + state_or_trans, attribute = kv.split(' ') + plotter.plot_y(model.by_name[state_or_trans][attribute]) + print('--- simple static model ---') static_model = model.get_static() #for state in model.states(): @@ -143,4 +153,11 @@ if __name__ == '__main__': else: model_quality_table([static_quality, analytic_quality, lut_quality], [None, param_info, None]) + if 'plot-param' in opts: + for kv in opts['plot-param'].split(';'): + state_or_trans, attribute, param_name, *functions = kv.split(' ') + if len(functions): + functions = [gplearn_to_function(' '.join(functions))] + plotter.plot_param(model, state_or_trans, attribute, model.param_index(param_name), extra_functions=functions) + sys.exit(0) |