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

Added suggestion to flatliner message. #486

Merged
merged 6 commits into from
Dec 11, 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
2 changes: 1 addition & 1 deletion openstef/tasks/create_forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def create_forecast_task(pj: PredictionJobDataClass, context: TaskContext) -> No
return
elif isinstance(e, InputDataOngoingZeroFlatlinerError):
raise InputDataOngoingZeroFlatlinerError(
'Consider adding this pid to the "known_zero_flatliners" app_setting.'
'All recent load measurements are zero. Check the load profile of this pid as well as related/neighbouring prediction jobs. Afterwards, consider adding this pid to the "known_zero_flatliners" app_setting and possibly removing other pids from the same app_setting.'
) from e
elif isinstance(e, LookupError):
raise LookupError(
Expand Down
2 changes: 1 addition & 1 deletion openstef/tasks/train_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def train_model_task(
return
else:
raise InputDataOngoingZeroFlatlinerError(
'All recent load measurements are zero. Consider adding this pid to the "known_zero_flatliners" app_setting.'
'All recent load measurements are zero. Check the load profile of this pid as well as related/neighbouring prediction jobs. Afterwards, consider adding this pid to the "known_zero_flatliners" app_setting and possibly removing other pids from the same app_setting.'
)


Expand Down
2 changes: 1 addition & 1 deletion test/unit/tasks/test_create_forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def test_create_forecast_unexpected_zero_flatliner(self):

assert (
e.value.args[0]
== 'Consider adding this pid to the "known_zero_flatliners" app_setting.'
== 'All recent load measurements are zero. Check the load profile of this pid as well as related/neighbouring prediction jobs. Afterwards, consider adding this pid to the "known_zero_flatliners" app_setting and possibly removing other pids from the same app_setting.'
)

@patch(
Expand Down
2 changes: 1 addition & 1 deletion test/unit/tasks/test_train_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def test_train_model_unexpected_zero_flatliner(self):
train_model_task(self.pj, context)
self.assertEqual(
e.value.args[0],
'All recent load measurements are zero. Consider adding this pid to the "known_zero_flatliners" app_setting.',
'All recent load measurements are zero. Check the load profile of this pid as well as related/neighbouring prediction jobs. Afterwards, consider adding this pid to the "known_zero_flatliners" app_setting and possibly removing other pids from the same app_setting.',
)

@patch("openstef.model.serializer.MLflowSerializer.save_model")
Expand Down
Loading