Skip to content

Commit

Permalink
Works for PLOG but badly fitting
Browse files Browse the repository at this point in the history
  • Loading branch information
tsikes committed May 4, 2021
1 parent 9fb5d64 commit e9d957f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/calculate/optimize/fit_fcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions src/calculate/optimize/mech_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e9d957f

Please sign in to comment.