summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2019-07-25 15:50:16 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2019-07-25 15:50:16 +0200
commitf00cd3e06832c965b47d0cc9b09a45f846efc760 (patch)
tree06f5016aeb4d045aafd8408cae410ae6648af0d7
parent97abc2d78fd4b82245d6c2a9bc76fc89349664ee (diff)
AnalyticModel: Add missing param_name / param_index functions
-rwxr-xr-xlib/dfatool.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/dfatool.py b/lib/dfatool.py
index 7eb7359..fbc5c7f 100755
--- a/lib/dfatool.py
+++ b/lib/dfatool.py
@@ -1093,6 +1093,16 @@ class AnalyticModel:
vprint(self.verbose, '[W] Got no data for {} {}: {}'.format(name, key, fpe))
return model
+ def param_index(self, param_name):
+ if param_name in self.parameters:
+ return self.parameters.index(param_name)
+ return len(self.parameters) + int(param_name)
+
+ def param_name(self, param_index):
+ if param_index < len(self.parameters):
+ return self.parameters[param_index]
+ return str(param_index)
+
def get_static(self):
"""
Get static model function: name, attribute -> model value.