summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-03-25 08:58:27 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-03-25 08:58:27 +0100
commit83e437a9b18bd4b8f0d3843f08ef0c729015c5b2 (patch)
treef879bd0bed7c117f54d977b75303454ffd0aa385
parent250e0b1afbbf27d0ddff63a12d649a1a186e9c20 (diff)
analyze-archive: fix useless extra-parsing of getopt args
-rwxr-xr-xbin/analyze-archive.py44
1 files changed, 22 insertions, 22 deletions
diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py
index 5f22b18..acbc452 100755
--- a/bin/analyze-archive.py
+++ b/bin/analyze-archive.py
@@ -185,35 +185,35 @@ if __name__ == '__main__':
optname = re.sub(r'^--', '', option)
opts[optname] = parameter
- if 'ignored-trace-indexes' in opts:
- ignored_trace_indexes = list(map(int, opts['ignored-trace-indexes'].split(',')))
- if 0 in ignored_trace_indexes:
- print('[E] arguments to --ignored-trace-indexes start from 1')
+ if 'ignored-trace-indexes' in opts:
+ ignored_trace_indexes = list(map(int, opts['ignored-trace-indexes'].split(',')))
+ if 0 in ignored_trace_indexes:
+ print('[E] arguments to --ignored-trace-indexes start from 1')
- if 'discard-outliers' in opts:
- discard_outliers = float(opts['discard-outliers'])
+ 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)
+ 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)
- if 'show-models' in opts:
- show_models = opts['show-models'].split(',')
+ if 'show-models' in opts:
+ show_models = opts['show-models'].split(',')
- if 'show-quality' in opts:
- show_quality = opts['show-quality'].split(',')
+ if 'show-quality' in opts:
+ show_quality = opts['show-quality'].split(',')
- if 'cross-validate' in opts:
- xv_method, xv_count = opts['cross-validate'].split(':')
- xv_count = int(xv_count)
+ if 'cross-validate' in opts:
+ xv_method, xv_count = opts['cross-validate'].split(':')
+ xv_count = int(xv_count)
- if 'with-safe-functions' in opts:
- safe_functions_enabled = True
+ if 'with-safe-functions' in opts:
+ safe_functions_enabled = True
- if 'hwmodel' in opts:
- with open(opts['hwmodel'], 'r') as f:
- hwmodel = json.load(f)
+ if 'hwmodel' in opts:
+ with open(opts['hwmodel'], 'r') as f:
+ hwmodel = json.load(f)
except getopt.GetoptError as err:
print(err)