From e9d957f823be4b4129c56ccbc11db135a0b20a85 Mon Sep 17 00:00:00 2001 From: tsikes <50559900+tsikes@users.noreply.github.com> Date: Mon, 3 May 2021 22:26:22 -0500 Subject: [PATCH] Works for PLOG but badly fitting --- src/calculate/optimize/fit_fcn.py | 2 +- src/calculate/optimize/mech_optimize.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/calculate/optimize/fit_fcn.py b/src/calculate/optimize/fit_fcn.py index 83a1bf5..ba9ebc2 100644 --- a/src/calculate/optimize/fit_fcn.py +++ b/src/calculate/optimize/fit_fcn.py @@ -58,7 +58,7 @@ def update_mech_coef_opt(mech, coef_opt, x): mech_changed = True mech.coeffs[rxnIdx][coeffs_key][coefName] = x[i] - + if mech_changed: mech.modify_reactions(mech.coeffs) # Update mechanism with new coefficients diff --git a/src/calculate/optimize/mech_optimize.py b/src/calculate/optimize/mech_optimize.py index 0914ae4..793a780 100644 --- a/src/calculate/optimize/mech_optimize.py +++ b/src/calculate/optimize/mech_optimize.py @@ -56,8 +56,8 @@ def start_threads(self): return # Specify coefficients to be optimized - self.coef_opt = coef_opt = self._set_coef_opt() - if not coef_opt: # if nothing to optimize, don't! + self.coef_opt = self._set_coef_opt() + if not self.coef_opt: # if nothing to optimize, don't! parent.log.append('No reactions or coefficients set to be optimized\n') return @@ -141,7 +141,7 @@ def start_threads(self): parent.max_processors = 1 # Pass the function to execute - self.worker = Worker(parent, self.shocks2run, parent.mech, coef_opt, rxn_coef_opt, rxn_rate_opt) + self.worker = Worker(parent, self.shocks2run, parent.mech, self.coef_opt, rxn_coef_opt, rxn_rate_opt) self.worker.signals.result.connect(self.on_worker_done) self.worker.signals.finished.connect(self.thread_complete) self.worker.signals.update.connect(self.update)