Skip to content

Commit

Permalink
tests: perf test reduce data length
Browse files Browse the repository at this point in the history
  • Loading branch information
Clarmy committed Jun 13, 2023
1 parent c1d8bec commit 8237a7a
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions tests/test_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ def inner():
benchmark(inner)


def test_calc_mae_1e9(benchmark):
def test_calc_mae_1e7(benchmark):
def inner():
obs = np.random.rand(int(1e9))
fct = np.random.rand(int(1e9))
obs = np.random.rand(int(1e7))
fct = np.random.rand(int(1e7))
calc_mae(obs, fct)

benchmark(inner)
Expand All @@ -54,10 +54,10 @@ def inner():
benchmark(inner)


def test_calc_mbe_1e9(benchmark):
def test_calc_mbe_1e7(benchmark):
def inner():
obs = np.random.rand(int(1e9))
fct = np.random.rand(int(1e9))
obs = np.random.rand(int(1e7))
fct = np.random.rand(int(1e7))
calc_mbe(obs, fct)

benchmark(inner)
Expand All @@ -81,10 +81,10 @@ def inner():
benchmark(inner)


def test_calc_threshold_hit_ratio_1e9(benchmark):
def test_calc_threshold_hit_ratio_1e7(benchmark):
def inner():
obs = np.random.rand(int(1e9))
fct = np.random.rand(int(1e9))
obs = np.random.rand(int(1e7))
fct = np.random.rand(int(1e7))
calc_threshold_hit_ratio(obs, fct, 0.5)

benchmark(inner)
Expand All @@ -108,10 +108,10 @@ def inner():
benchmark(inner)


def test_calc_threshold_false_alarm_ratio_1e9(benchmark):
def test_calc_threshold_false_alarm_ratio_1e7(benchmark):
def inner():
obs = np.random.rand(int(1e9))
fct = np.random.rand(int(1e9))
obs = np.random.rand(int(1e7))
fct = np.random.rand(int(1e7))
calc_threshold_false_alarm_ratio(obs, fct, 0.5)

benchmark(inner)
Expand All @@ -135,10 +135,10 @@ def inner():
benchmark(inner)


def test_calc_threshold_ts_1e9(benchmark):
def test_calc_threshold_ts_1e7(benchmark):
def inner():
obs = np.random.rand(int(1e9))
fct = np.random.rand(int(1e9))
obs = np.random.rand(int(1e7))
fct = np.random.rand(int(1e7))
calc_threshold_ts(obs, fct, 0.5)

benchmark(inner)

0 comments on commit 8237a7a

Please sign in to comment.