Benchmarks added

This commit is contained in:
Fabian Joswig 2021-10-26 10:20:47 +01:00
parent 8655fe2cd1
commit b5f3dd6ac3
9 changed files with 58 additions and 1 deletions

19
tests/roots_test.py Normal file
View file

@ -0,0 +1,19 @@
import numpy as np
import pyerrors as pe
import pytest
np.random.seed(0)
def test_root_linear():
def root_function(x, d):
return x - d
value = np.random.normal(0, 100)
my_obs = pe.pseudo_Obs(value, 0.1, 't')
my_root = pe.roots.find_root(my_obs, root_function)
assert np.isclose(my_root.value, value)
difference = my_obs - my_root
assert difference.is_zero()