fix: Error handling for fits and root finding with numpy instead of autograd.numpy

improved. Tests added.
This commit is contained in:
Fabian Joswig 2022-03-02 15:10:07 +00:00
parent 7f5989dfb9
commit b14314b424
4 changed files with 53 additions and 10 deletions

View file

@ -30,3 +30,15 @@ def test_root_linear_idl():
difference = my_obs - my_root
assert difference.is_zero()
def test_root_no_autograd():
def root_function(x, d):
return x - np.log(np.exp(d))
value = np.random.normal(0, 100)
my_obs = pe.pseudo_Obs(value, 0.1, 't')
with pytest.raises(Exception):
my_root = pe.roots.find_root(my_obs, root_function)