Skip to content

Commit

Permalink
use benchmark in test_calc_wsratio_v_wd_scen
Browse files Browse the repository at this point in the history
  • Loading branch information
aclerc committed Sep 13, 2024
1 parent b7b74b6 commit 329ba8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ build-backend = "setuptools.build_meta"
[project.optional-dependencies]
dev = [
'pytest',
'pytest-benchmark',
'coverage',
'poethepoet',
'types-pyyaml',
Expand Down
5 changes: 3 additions & 2 deletions tests/test_detrend.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_check_applied_detrend(test_lsa_t13_config: WindUpConfig) -> None:
assert detrend_post_r2_improvement == pytest.approx(0.03776561982402227)


def test_calc_wsratio_v_wd_scen(test_lsa_t13_config: WindUpConfig) -> None:
def test_calc_wsratio_v_wd_scen(benchmark, test_lsa_t13_config: WindUpConfig) -> None:
# this test case borrows logic and results from check_applied_detrend where data which has already been detrended
# is used to calculate the wsratio_v_wd_scen again to check it is flat
cfg = test_lsa_t13_config
Expand All @@ -85,7 +85,8 @@ def test_calc_wsratio_v_wd_scen(test_lsa_t13_config: WindUpConfig) -> None:
expected_pre_df = pd.read_parquet(
Path(__file__).parents[0] / "test_data/LSA_T13_LSA_T12_check_pre_wsratio_v_dir_scen.parquet",
)
actual_pre_df = calc_wsratio_v_wd_scen(
actual_pre_df = benchmark(
calc_wsratio_v_wd_scen,
test_name=test_name,
ref_name=ref_name,
ref_lat=ref_lat,
Expand Down

0 comments on commit 329ba8f

Please sign in to comment.