Example:
importadaptiveadaptive.notebook_extension()
importnumpyasnpbounds= [(1, 1.7), (250, 550)]
learner=adaptive.Learner2D(lambdax: x[0] *x[1], bounds=bounds)
adaptive.runner.simple(learner, goal=lambdal: l.npoints>=2000)
plot_data=learner.plot().Image.I.dataprint(np.sum(np.isnan(plot_data)))
>>>47
The issue is the precision in Learner2D._scale (which is called by Learner2D.ip, which itself is used to make the plot):
points, values=learner._data_in_bounds()
points=learner._scale(points)
print(np.min(points[:, 0]), np.max(points[:, 0]))
>>>-0.50000000000000010.49999999999999983
Points lying exactly at x = 0.5 will be outside of the convex hull of points and scipy.interpolate.LinearNDInterpolatorfills them with nan.
Example:
The issue is the precision in
Learner2D._scale(which is called byLearner2D.ip, which itself is used to make the plot):Points lying exactly at
x = 0.5will be outside of the convex hull ofpointsandscipy.interpolate.LinearNDInterpolatorfills them withnan.