diff --git a/.gitignore b/.gitignore index 77feb98c..fdaac56f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ examples/B1k2_pcac_plateau.p examples/Untitled.* core.* *.swp +htmlcov diff --git a/pyerrors/fits.py b/pyerrors/fits.py index 85e28557..1651cd93 100644 --- a/pyerrors/fits.py +++ b/pyerrors/fits.py @@ -678,7 +678,7 @@ def qqplot(x, o_y, func, p): plt.xlabel('Theoretical quantiles') plt.ylabel('Ordered Values') plt.legend() - plt.show() + plt.draw() def residual_plot(x, y, func, fit_res): @@ -707,7 +707,7 @@ def residual_plot(x, y, func, fit_res): ax1.set_xlim([xstart, xstop]) ax1.set_ylabel('Residuals') plt.subplots_adjust(wspace=None, hspace=None) - plt.show() + plt.draw() def covariance_matrix(y): @@ -782,7 +782,7 @@ def ks_test(obs=None): loc_max_diff = np.argmax(np.abs(diffs)) loc = Xs[loc_max_diff] plt.annotate(s='', xy=(loc, loc), xytext=(loc, loc + diffs[loc_max_diff]), arrowprops=dict(arrowstyle='<->', shrinkA=0, shrinkB=0)) - plt.show() + plt.draw() print(scipy.stats.kstest(Qs, 'uniform')) diff --git a/tests/fits_test.py b/tests/fits_test.py index 5d7f1de3..53a23dc9 100644 --- a/tests/fits_test.py +++ b/tests/fits_test.py @@ -29,7 +29,7 @@ def test_least_squares(): y = a[0] * np.exp(-a[1] * x) return y - out = pe.least_squares(x, oy, func) + out = pe.least_squares(x, oy, func, expected_chisquare=True, resplot=True, qqplot=True) beta = out.fit_parameters for i in range(2): @@ -133,7 +133,7 @@ def test_total_least_squares(): odr.set_job(fit_type=0, deriv=1) output = odr.run() - out = pe.total_least_squares(ox, oy, func) + out = pe.total_least_squares(ox, oy, func, expected_chisquare=True) beta = out.fit_parameters for i in range(2):