mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
fix: Error handling for fits and root finding with numpy instead of autograd.numpy
improved. Tests added.
This commit is contained in:
parent
7f5989dfb9
commit
b14314b424
4 changed files with 53 additions and 10 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue