diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2019-07-25 15:50:16 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2019-07-25 15:50:16 +0200 |
commit | f00cd3e06832c965b47d0cc9b09a45f846efc760 (patch) | |
tree | 06f5016aeb4d045aafd8408cae410ae6648af0d7 /lib | |
parent | 97abc2d78fd4b82245d6c2a9bc76fc89349664ee (diff) |
AnalyticModel: Add missing param_name / param_index functions
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/dfatool.py | 10 |
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. |