Skip to content

Commit

Permalink
Merge pull request #2 from views-platform/test_ensemble_manager
Browse files Browse the repository at this point in the history
Test ensemble manager
  • Loading branch information
smellycloud authored Dec 10, 2024
2 parents 23370cf + f9b0120 commit 31dc5c8
Show file tree
Hide file tree
Showing 13 changed files with 1,176 additions and 259 deletions.
2 changes: 1 addition & 1 deletion documentation/ADRs/012_artifact_naming_convention.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The naming convention for a single model artifact will follow this structure:
```
<run_type>_model_<timestamp>.pkl
```
- run_type: The type of run (e.g., calibration, testing, forecasting).
- run_type: The type of run (e.g., calibration, validation, forecasting).
- timestamp: The timestamp when the model was trained. The format is`YYYYMMDD_HHMMSS`.

Training is not an option for ensemble models right now as they are made by aggregating single models. So no decision has been made on the naming convention for ensemble models yet.
Expand Down
4 changes: 2 additions & 2 deletions documentation/ADRs/013_output_naming_convention.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ The evaluation/output naming convention for using a single model will follow thi
<evaluation/output>_<max_forecast_step>_<run_type>_<timestamp>.pkl
```
- max_forecast_step: The maximum forecast step for the prediction.
- run_type: The type of run (e.g., calibration, testing).
- run_type: The type of run (e.g., calibration, validation).
- timestamp: The timestamp when the model was trained. The format is`YYYYMMDD_HHMMSS`.

The evaluation naming convention for using an ensemble model will follow this structure:
```
<evaluation/output>_<max_forecast_step>_<run_type>_<model_name_1><timestamp_1>_<model_name2><timestamp_2>.pkl
```
- max_forecast_step: The maximum forecast step for the prediction.
- run_type: The type of run (e.g., calibration, testing).
- run_type: The type of run (e.g., calibration, validation).
- model_name: The name of the model used for the ensemble prediction.
- timestamp: The timestamp when the model was trained. The format is`YYYYMMDD_HHMMSS`.

Expand Down
12 changes: 6 additions & 6 deletions tests/test_cli_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ def test_parse_args_run_type_calibration():

assert args.run_type == "calibration"

def test_parse_args_run_type_testing():
def test_parse_args_run_type_validation():
"""
Test the run_type argument with value 'testing'.
Test the run_type argument with value 'validation'.
"""
sys.argv = ["main.py", "--run_type", "testing"]
sys.argv = ["main.py", "--run_type", "validation"]
args = parse_args()

assert args.run_type == "testing"
assert args.run_type == "validation"

def test_parse_args_run_type_forecasting():
"""
Expand Down Expand Up @@ -87,7 +87,7 @@ def test_parse_args_invalid_run_type_with_sweep():
"""
Test invalid combination of --run_type and --sweep flags.
"""
sys.argv = ["main.py", "--run_type", "testing", "--sweep"]
sys.argv = ["main.py", "--run_type", "validation", "--sweep"]
with pytest.raises(SystemExit):
args = parse_args()
validate_arguments(args)
Expand All @@ -104,7 +104,7 @@ def test_validate_arguments_sweep_with_non_calibration():
"""
Test validate_arguments with --sweep and non-calibration run_type.
"""
sys.argv = ["main.py", "--run_type", "testing", "--sweep"]
sys.argv = ["main.py", "--run_type", "validation", "--sweep"]
args = parse_args()
with pytest.raises(SystemExit):
validate_arguments(args)
Expand Down
Loading

0 comments on commit 31dc5c8

Please sign in to comment.