Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ENH] rewrite test_probabilistic_metrics using proper pytest fixtures (…
…#4946) #### Reference Issues/PRs Fixes #4907 #### What does this implement/fix? Explain your changes. Moved the sample data generation inside fixtures, so it doesn't run with each import, but only when testing is performed. Moreover refactored the tests such that the output tests for interval predictions and quantile predictions are separated. Reason: With only one parametrized test were 96 parameter combinations, which made the test very slow and CPU heavy. Also, some parameter combinations are not necessary (quantile metrics belong to quantile forecast only and interval metrics only to interval forecast) - please correct me if I'm wrong. Separating the tests speeds up the testing process considerably and makes debugging easier. #### Did you add any tests for the change? Added the test `test_sample_data()` to check if the sample data generating fixture `sample_data()` is working correctly. #### Any other comments? The output test function contains many nested if - else statements. In my opinion, these should be separate tests with separate parametrized inputs, instead of putting all inputs in one test, and then distinguishing with if-else statements.
- Loading branch information
1 parent
ed4efe9
commit f4815d7
Showing
2 changed files
with
112 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters