fixed seed added to tests

This commit is contained in:
Fabian Joswig 2021-10-15 13:05:00 +01:00
parent 1b63f5dd3b
commit bb9790acd7
4 changed files with 12 additions and 1 deletions

View file

@ -9,6 +9,8 @@ from scipy.odr import ODR, Model, Data, RealData
import pyerrors as pe
import pytest
np.random.seed(0)
def test_standard_fit():
dim = 10 + int(30 * np.random.rand())
x = np.arange(dim)

View file

@ -11,6 +11,8 @@ from scipy.odr import ODR, Model, Data, RealData
import pyerrors as pe
import pytest
np.random.seed(0)
def test_matrix_functions():
dim = 3 + int(4 * np.random.rand())
print(dim)

View file

@ -6,6 +6,8 @@ import copy
import pyerrors as pe
import pytest
np.random.seed(0)
def test_dump():
value = np.random.normal(5, 10)
dvalue = np.abs(np.random.normal(0, 1))

View file

@ -2,7 +2,9 @@ import numpy as np
import pyerrors as pe
import pytest
def test_find_root():
np.random.seed(0)
def test_root_linear():
def root_function(x, d):
return x - d
@ -12,3 +14,6 @@ def test_find_root():
my_root = pe.roots.find_root(my_obs, root_function)
assert np.isclose(my_root.value, value)
difference = my_obs - my_root
assert all(np.isclose(0.0, difference.deltas['t']))