Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update dazls #468

Merged
merged 5 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified openstef/data/dazls_stored.sav
Binary file not shown.
Binary file added openstef/data/dazls_stored_3.2.49.sav
Binary file not shown.
3 changes: 3 additions & 0 deletions openstef/data/dazls_stored_3.2.49.sav.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2017-2023 Contributors to the OpenSTEF project <[email protected]>

SPDX-License-Identifier: MPL-2.0
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plotly~=5.14
pvlib==0.9.4
pydantic~=1.10
pymsteams~=0.2.2 # TODO remove teams dependency
scikit-learn~=1.2
scikit-learn~=1.3
scipy~=1.10
statsmodels~=0.13.5
structlog~=23.1
Expand Down
19 changes: 17 additions & 2 deletions test/unit/pipeline/test_create_component_forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
#
# SPDX-License-Identifier: MPL-2.0
from datetime import datetime, timedelta, timezone
import unittest
from test.unit.utils.base import BaseTestCase
from test.unit.utils.data import TestData
import joblib

import pandas as pd

from pathlib import Path

PROJECT_ROOT = Path(__file__).parent.parent.parent.parent.absolute()

from openstef.pipeline.create_component_forecast import (
create_components_forecast_pipeline,
)
Expand All @@ -18,7 +22,18 @@ def setUp(self) -> None:
super().setUp()
self.PJ = TestData.get_prediction_job(pid=307)

@unittest.skip("Does work offline, but not online.")
def test_load_dazls_model(self):
"""Version updates of sklearn could break pickle.load
Let's test for that explicitly
Assert that loading the old model generates an exception and the new model does not"""

old_model_file = PROJECT_ROOT / "openstef/data/dazls_stored_3.2.49.sav"
new_model_file = PROJECT_ROOT / "openstef/data/dazls_stored.sav"

self.assertRaises(Exception, joblib.load, old_model_file)
dazls_model = joblib.load(new_model_file)
assert dazls_model

def test_component_forecast_pipeline_happy_flow(self):
# Test happy flow
data = TestData.load("reference_sets/307-test-data.csv")
Expand Down
Loading