2023-01-18 15:03:08 +00:00
|
|
|
import numpy as np
|
|
|
|
import matplotlib.pyplot as plt
|
|
|
|
import pyerrors as pe
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
|
|
def test_obs_errorbar():
|
|
|
|
x_float = np.arange(5)
|
|
|
|
x_obs = []
|
|
|
|
y_obs = []
|
|
|
|
for x in x_float:
|
|
|
|
x_obs.append(pe.pseudo_Obs(x, 0.1, "test"))
|
|
|
|
y_obs.append(pe.pseudo_Obs(x ** 2, 0.1, "test"))
|
|
|
|
|
2023-01-18 17:01:37 +00:00
|
|
|
for xerr in [2, None]:
|
|
|
|
for yerr in [0.1, None]:
|
|
|
|
pe.errorbar(x_float, y_obs, marker="x", ms=2, xerr=xerr, yerr=yerr)
|
|
|
|
pe.errorbar(x_obs, y_obs, marker="x", ms=2, xerr=xerr, yerr=yerr)
|
2023-01-18 15:03:08 +00:00
|
|
|
|
2023-01-18 17:01:37 +00:00
|
|
|
plt.close('all')
|
2023-07-10 15:44:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
def test_print_config():
|
|
|
|
pe.print_config()
|