Skip to content

Commit f45b6e6

Browse files
committed
don't treat the no data case differently
1 parent f268f0d commit f45b6e6

File tree

2 files changed

+1894
-14
lines changed

2 files changed

+1894
-14
lines changed

adaptive/learner/learner1D.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -590,12 +590,11 @@ def plot(self):
590590
Plot of the evaluated data.
591591
"""
592592
hv = ensure_holoviews()
593-
if not self.data:
594-
p = hv.Scatter([]) * hv.Path([])
595-
elif not self.vdim > 1:
596-
p = hv.Scatter(self.data) * hv.Path([])
593+
594+
xs, ys = zip(*sorted(self.data.items())) if self.data else ([], [])
595+
if self.vdim == 1:
596+
p = hv.Path([]) * hv.Scatter((xs, ys))
597597
else:
598-
xs, ys = zip(*sorted(self.data.items()))
599598
p = hv.Path((xs, ys)) * hv.Scatter([])
600599

601600
# Plot with 5% empty margins such that the boundary points are visible

learner.ipynb

+1,890-9
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)