diff --git a/tests/test_perf.py b/tests/test_perf.py index 48b46d6..c09c647 100644 --- a/tests/test_perf.py +++ b/tests/test_perf.py @@ -10,135 +10,150 @@ def test_calc_mae_1e3(benchmark): + obs = np.random.rand(int(1e3)) + fct = np.random.rand(int(1e3)) + def inner(): - obs = np.random.rand(int(1e3)) - fct = np.random.rand(int(1e3)) calc_mae(obs, fct) benchmark(inner) def test_calc_mae_1e6(benchmark): + obs = np.random.rand(int(1e6)) + fct = np.random.rand(int(1e6)) + def inner(): - obs = np.random.rand(int(1e6)) - fct = np.random.rand(int(1e6)) calc_mae(obs, fct) benchmark(inner) def test_calc_mae_1e7(benchmark): + obs = np.random.rand(int(1e7)) + fct = np.random.rand(int(1e7)) + def inner(): - obs = np.random.rand(int(1e7)) - fct = np.random.rand(int(1e7)) calc_mae(obs, fct) benchmark(inner) def test_calc_mbe_1e3(benchmark): + obs = np.random.rand(int(1e3)) + fct = np.random.rand(int(1e3)) + def inner(): - obs = np.random.rand(int(1e3)) - fct = np.random.rand(int(1e3)) calc_mbe(obs, fct) benchmark(inner) def test_calc_mbe_1e6(benchmark): + obs = np.random.rand(int(1e6)) + fct = np.random.rand(int(1e6)) + def inner(): - obs = np.random.rand(int(1e6)) - fct = np.random.rand(int(1e6)) calc_mbe(obs, fct) benchmark(inner) def test_calc_mbe_1e7(benchmark): + obs = np.random.rand(int(1e7)) + fct = np.random.rand(int(1e7)) + def inner(): - obs = np.random.rand(int(1e7)) - fct = np.random.rand(int(1e7)) calc_mbe(obs, fct) benchmark(inner) def test_calc_threshold_hit_ratio_1e3(benchmark): + obs = np.random.rand(int(1e3)) + fct = np.random.rand(int(1e3)) + def inner(): - obs = np.random.rand(int(1e3)) - fct = np.random.rand(int(1e3)) calc_threshold_hit_ratio(obs, fct, 0.5) benchmark(inner) def test_calc_threshold_hit_ratio_1e6(benchmark): + obs = np.random.rand(int(1e6)) + fct = np.random.rand(int(1e6)) + def inner(): - obs = np.random.rand(int(1e6)) - fct = np.random.rand(int(1e6)) calc_threshold_hit_ratio(obs, fct, 0.5) benchmark(inner) def test_calc_threshold_hit_ratio_1e7(benchmark): + obs = np.random.rand(int(1e7)) + fct = np.random.rand(int(1e7)) + def inner(): - obs = np.random.rand(int(1e7)) - fct = np.random.rand(int(1e7)) calc_threshold_hit_ratio(obs, fct, 0.5) benchmark(inner) def test_calc_threshold_false_alarm_ratio_1e3(benchmark): + obs = np.random.rand(int(1e3)) + fct = np.random.rand(int(1e3)) + def inner(): - obs = np.random.rand(int(1e3)) - fct = np.random.rand(int(1e3)) calc_threshold_false_alarm_ratio(obs, fct, 0.5) benchmark(inner) def test_calc_threshold_false_alarm_ratio_1e6(benchmark): + obs = np.random.rand(int(1e6)) + fct = np.random.rand(int(1e6)) + def inner(): - obs = np.random.rand(int(1e6)) - fct = np.random.rand(int(1e6)) calc_threshold_false_alarm_ratio(obs, fct, 0.5) benchmark(inner) def test_calc_threshold_false_alarm_ratio_1e7(benchmark): + obs = np.random.rand(int(1e7)) + fct = np.random.rand(int(1e7)) + def inner(): - obs = np.random.rand(int(1e7)) - fct = np.random.rand(int(1e7)) calc_threshold_false_alarm_ratio(obs, fct, 0.5) benchmark(inner) def test_calc_threshold_ts_1e3(benchmark): + obs = np.random.rand(int(1e3)) + fct = np.random.rand(int(1e3)) + def inner(): - obs = np.random.rand(int(1e3)) - fct = np.random.rand(int(1e3)) calc_threshold_ts(obs, fct, 0.5) benchmark(inner) def test_calc_threshold_ts_1e6(benchmark): + obs = np.random.rand(int(1e6)) + fct = np.random.rand(int(1e6)) + def inner(): - obs = np.random.rand(int(1e6)) - fct = np.random.rand(int(1e6)) calc_threshold_ts(obs, fct, 0.5) benchmark(inner) def test_calc_threshold_ts_1e7(benchmark): + obs = np.random.rand(int(1e7)) + fct = np.random.rand(int(1e7)) + def inner(): - obs = np.random.rand(int(1e7)) - fct = np.random.rand(int(1e7)) calc_threshold_ts(obs, fct, 0.5) benchmark(inner)