assert each fap value
@@ -65,7 +65,9 @@ def simulate_test_data(period, amplitude, t_length, n_data, n_obs, n_outliers):
@pytest.mark.parametrize('test_case', [
dict(period=7, amplitude=2, t_length=100, n_data=1000,
n_observations=1000 / 2, n_outliers=0, dt=0.5,
- max_period=None, criteria='all', n_bootstraps=10),
+ max_period=None, criteria='all', n_bootstraps=10,
+ fap=[2.220446*10**-14, 1.401101*10**-11, 5.659984*10**-9, 0.0],
+ ),
])
def test_lomb_scargle(test_case):
test_data = simulate_test_data(
@@ -76,5 +78,6 @@ def test_lomb_scargle(test_case):
test_data['t'], test_data['y'], test_data['dy'], test_case['dt'],
test_case['max_period'], test_case['criteria'], test_case['n_bootstraps'],
)
+ print(result['fap'])
assert_allclose(result['period'], test_case['period'], atol=test_case['dt'], )
- assert_allclose(list(result['fap'].values()), 0, atol=1)
+ assert_allclose(list(result['fap'].values()), test_case['fap'], rtol=1e-06, atol=0)
