Skip to content

Commit 3c3f11d

Browse files
author
Julian Blank
committed
0.5.0.rc4
1 parent 088b8df commit 3c3f11d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

pymoo/util/running_metric.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ def do(self, _, algorithm, force_plot=False, **kwargs):
3131
metrics = self.term.metrics
3232
tau = len(metrics)
3333

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

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

74-
return True
7576

76-
return False

pymoo/visualization/video/callback_video.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ def notify(self, algorithm, **kwargs):
3838
figure = self.do(algorithm.problem, algorithm, **kwargs)
3939

4040
if self.do_show:
41-
if figure is None:
42-
plt.show()
43-
else:
41+
if figure is not None:
4442
figure.show()
43+
else:
44+
plt.show()
4545

4646
if self.video is not None:
4747
self.video.record(fig=figure)

0 commit comments

Comments
 (0)