summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-02-21 09:37:58 +0100
committerDaniel Friesel <derf@finalrewind.org>2018-02-21 09:37:58 +0100
commitf0af391298dc1d13f9a802ad204f819f700cf55e (patch)
treec54c7ca9336ce4e1416ab7c5bd474c553ce70a76 /lib
parent1e02f2ba0bdf50dc3c870f2ace91ccf1f7ee8000 (diff)
decrease _try_fits IPC overhead
Diffstat (limited to 'lib')
-rwxr-xr-xlib/dfatool.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/dfatool.py b/lib/dfatool.py
index 6976d13..f224e1b 100755
--- a/lib/dfatool.py
+++ b/lib/dfatool.py
@@ -825,6 +825,8 @@ class EnergyModel:
param_model = dict([[state_or_tran, {}] for state_or_tran in self.by_name.keys()])
fit_queue = []
for state_or_tran in self.by_name.keys():
+ param_keys = filter(lambda k: k[0] == state_or_tran, self.by_param.keys())
+ param_subdict = dict(map(lambda k: [k, self.by_param[k]], param_keys))
num_args = 0
if self.by_name[state_or_tran]['isa'] == 'state':
attributes = ['power']
@@ -846,7 +848,7 @@ class EnergyModel:
if self.param_dependence_ratio(state_or_tran, model_attribute, _arg_name(arg_index)) > 0.5:
fit_queue.append({
'key' : [state_or_tran, model_attribute, _arg_name(arg_index)],
- 'args' : [self.by_param, state_or_tran, model_attribute, len(self._parameter_names) + arg_index]
+ 'args' : [param_subdict, state_or_tran, model_attribute, len(self._parameter_names) + arg_index]
})
#fit_results[_arg_name(arg_index)] = _try_fits(self.by_param, state_or_tran, model_attribute, len(self._parameter_names) + arg_index)
#if 'args' in self.by_name[state_or_tran]: