mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-03-15 14:50:25 +01:00
Tests made more rigorous
This commit is contained in:
parent
8aa3fba222
commit
e1fd4606d3
2 changed files with 3 additions and 7 deletions
|
@ -94,15 +94,11 @@ def test_matrix_functions():
|
|||
|
||||
for (i, j), entry in np.ndenumerate(check):
|
||||
diff = entry - sym[i, j]
|
||||
diff.gamma_method()
|
||||
assert math.isclose(diff.value, 0.0, abs_tol=1e-9), 'value ' + str(i) + ',' + str(j)
|
||||
assert math.isclose(diff.dvalue, 0.0, abs_tol=1e-9), 'dvalue ' + str(i) + ',' + str(j)
|
||||
assert diff.is_zero()
|
||||
|
||||
# Check eigh
|
||||
e, v = pe.linalg.eigh(sym)
|
||||
for i in range(dim):
|
||||
tmp = sym @ v[:, i] - v[:, i] * e[i]
|
||||
for j in range(dim):
|
||||
tmp[j].gamma_method()
|
||||
assert math.isclose(tmp[j].value, 0.0, abs_tol=1e-9), 'value ' + str(i) + ',' + str(j)
|
||||
assert math.isclose(tmp[j].dvalue, 0.0, abs_tol=1e-9), 'dvalue ' + str(i) + ',' + str(j)
|
||||
assert tmp[j].is_zero()
|
||||
|
|
|
@ -245,4 +245,4 @@ def test_cobs():
|
|||
assert np.allclose(0.0, diff.real.deltas['t'])
|
||||
assert np.allclose(0.0, diff.imag.deltas['t'])
|
||||
|
||||
div = my_cobs / other
|
||||
assert (my_cobs / other * other - my_cobs).is_zero()
|
||||
|
|
Loading…
Add table
Reference in a new issue