Skip to content

Commit

Permalink
0.5.0.rc4
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Blank committed Sep 8, 2021
1 parent 088b8df commit 3c3f11d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pymoo/util/running_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def do(self, _, algorithm, force_plot=False, **kwargs):
metrics = self.term.metrics
tau = len(metrics)

fig = None

if metric is not None and (tau + 1) % self.delta_gen == 0 or force_plot:

_delta_f = metric["delta_f"]
Expand Down Expand Up @@ -71,6 +73,4 @@ def press(event):
self.hist.append((tau, _delta_f))
self.hist = self.hist[-(self.n_plots - 1):]

return True

return False
6 changes: 3 additions & 3 deletions pymoo/visualization/video/callback_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ def notify(self, algorithm, **kwargs):
figure = self.do(algorithm.problem, algorithm, **kwargs)

if self.do_show:
if figure is None:
plt.show()
else:
if figure is not None:
figure.show()
else:
plt.show()

if self.video is not None:
self.video.record(fig=figure)
Expand Down

0 comments on commit 3c3f11d

Please sign in to comment.