Skip to content

Commit

Permalink
Merge pull request #35 from peonor/patch-1
Browse files Browse the repository at this point in the history
Merging Per-Ola's changes to simplex, which were made in reference to issue #22.
  • Loading branch information
ericchansen committed Jun 28, 2016
2 parents a809c7b + e12dce3 commit be48267
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions simplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ def run(self, r_data=None):
# Still make that FF copy.
ff_copy = copy.deepcopy(self.ff)
# Add your copy of the orignal to FF to the forward differentiated FFs.
self.new_ffs = sorted(self.new_ffs + [ff_copy], key=lambda x: x.score)
# Double check and make sure they're all scored.
for ff in self.new_ffs:
if ff.score is None:
Expand All @@ -170,10 +169,8 @@ def run(self, r_data=None):
data = calculate.main(self.args_ff)
ff.score = compare.compare_data(r_data, data)
opt.pretty_ff_results(ff)
self.new_ffs = sorted(self.new_ffs + [ff_copy], key=lambda x: x.score)
wrapper = textwrap.TextWrapper(width=79)
logger.log(20, 'ORDERED FF SCORES:')
logger.log(20, wrapper.fill('{}'.format(
' '.join('{:15.4f}'.format(x.score) for x in self.new_ffs))))
# Shows all FFs parameters.
opt.pretty_ff_params(self.new_ffs)
# Start the simplex cycles.
Expand All @@ -186,6 +183,9 @@ def run(self, r_data=None):
best_ff = self.new_ffs[0]
logger.log(20, '~~ START SIMPLEX CYCLE {} ~~'.format(
current_cycle).rjust(79, '~'))
logger.log(20, 'ORDERED FF SCORES:')
logger.log(20, wrapper.fill('{}'.format(
' '.join('{:15.4f}'.format(x.score) for x in self.new_ffs))))
inv_ff = self.ff.__class__()
if self.do_weighted_reflection:
inv_ff.method = 'WEIGHTED INVERSION'
Expand Down

0 comments on commit be48267

Please sign in to comment.