def test_datacontour(override_plot_backend): p = plot.DataContour() r = p._repr_html_() check_empty(r, 'DataContour', nsummary=7) x0 = np.asarray([[10, 20, 30], [10, 20, 30]]) x1 = np.asarray([[5, 5, 5], [15, 15, 15]]) y = np.arange(x0.size) d = Data2D('n n', x0.flatten(), x1.flatten(), y.flatten()) p.prepare(d) r = p._repr_html_() check_full(r, 'DataContour', 'x1', 'n n', nsummary=7)
def test_fitcontour(override_plot_backend): p = plot.FitContour() r = p._repr_html_() assert r is None # note: always None x0 = np.asarray([[10, 20, 30], [10, 20, 30]]) x1 = np.asarray([[5, 5, 5], [15, 15, 15]]) y = np.arange(x0.size) d = Data2D('n n', x0.flatten(), x1.flatten(), y.flatten()) # need somethig we can contour m = Gauss2D() m.xpos = 21 m.ypos = 9 m.fwhm = 5 dplot = plot.DataContour() dplot.prepare(d) mplot = plot.ModelContour() mplot.prepare(d, m, stat=None) p.prepare(dplot, mplot) r = p._repr_html_() # different to previous checks assert r is not None if plot.backend.name == 'pylab': assert '<summary>FitContour</summary>' in r assert '<svg ' in r return assert '<summary>DataContour (' in r assert '<summary>ModelContour (' in r assert '<div class="dataval">n n</div>' in r assert '<div class="dataval">Model</div>' in r