| @@ 94-110 (lines=17) @@ | ||
| 91 | ) |
|
| 92 | ||
| 93 | ||
| 94 | @pytest.mark.parametrize( |
|
| 95 | "name, result", |
|
| 96 | [ |
|
| 97 | ("Ap", np.array([56, 39, 27, 18, 32, 15, 32, 22])), |
|
| 98 | ("Kp", np.array([5.3, 4.7, 4.0, 3.3, 4.3, 3.0, 4.3, 3.7])), |
|
| 99 | ] |
|
| 100 | ) |
|
| 101 | def test_3hourly_index(name, result): |
|
| 102 | df = ap_kp_3h() |
|
| 103 | np.testing.assert_allclose( |
|
| 104 | df.loc[ |
|
| 105 | pd.date_range( |
|
| 106 | "2000-01-01 01:30", "2000-01-01 23:30", freq="3h" |
|
| 107 | ) |
|
| 108 | ][name].values, |
|
| 109 | result, |
|
| 110 | rtol=1e-12, |
|
| 111 | ) |
|
| 112 | ||
| @@ 66-82 (lines=17) @@ | ||
| 63 | pd.testing.assert_series_equal(df1_ind, df2_ind) |
|
| 64 | ||
| 65 | ||
| 66 | @pytest.mark.parametrize( |
|
| 67 | "name, result", |
|
| 68 | [ |
|
| 69 | ("Ap", np.array([56, 39, 27, 18, 32, 15, 32, 22])), |
|
| 70 | ("Kp", np.array([5.3, 4.7, 4.0, 3.3, 4.3, 3.0, 4.3, 3.7])), |
|
| 71 | ] |
|
| 72 | ) |
|
| 73 | def test_3hourly_index(name, result): |
|
| 74 | df = omnie_hourly(2000) |
|
| 75 | np.testing.assert_allclose( |
|
| 76 | df.loc[ |
|
| 77 | pd.date_range( |
|
| 78 | "2000-01-01 00:00", "2000-01-01 23:00", freq="3h" |
|
| 79 | ) |
|
| 80 | ][name].values, |
|
| 81 | result, |
|
| 82 | rtol=1e-12, |
|
| 83 | ) |
|
| 84 | ||