From d02ea8f586dfc3ebf7dfeec874a3a6c1a7979a27 Mon Sep 17 00:00:00 2001 From: Bart Pleiter Date: Fri, 8 Dec 2023 11:41:32 +0100 Subject: [PATCH 1/6] Added suggestion to flatliner message. Signed-off-by: Bart Pleiter --- openstef/tasks/create_forecast.py | 2 +- openstef/tasks/train_model.py | 2 +- test/unit/tasks/test_create_forecast.py | 2 +- test/unit/tasks/test_train_model.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openstef/tasks/create_forecast.py b/openstef/tasks/create_forecast.py index 91b0ae49c..625866519 100644 --- a/openstef/tasks/create_forecast.py +++ b/openstef/tasks/create_forecast.py @@ -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.' + 'Consider adding this pid to the "known_zero_flatliners" app_setting, and check the relevant existing flatliners.' ) from e elif isinstance(e, LookupError): raise LookupError( diff --git a/openstef/tasks/train_model.py b/openstef/tasks/train_model.py index a1f383c08..b2d972072 100644 --- a/openstef/tasks/train_model.py +++ b/openstef/tasks/train_model.py @@ -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. Consider adding this pid to the "known_zero_flatliners" app_setting, and check the relevant existing flatliners.' ) diff --git a/test/unit/tasks/test_create_forecast.py b/test/unit/tasks/test_create_forecast.py index 8ca0197d1..cb85f1529 100644 --- a/test/unit/tasks/test_create_forecast.py +++ b/test/unit/tasks/test_create_forecast.py @@ -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.' + == 'Consider adding this pid to the "known_zero_flatliners" app_setting, and check the relevant existing flatliners.' ) @patch( diff --git a/test/unit/tasks/test_train_model.py b/test/unit/tasks/test_train_model.py index 2054c3962..346404f68 100644 --- a/test/unit/tasks/test_train_model.py +++ b/test/unit/tasks/test_train_model.py @@ -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. Consider adding this pid to the "known_zero_flatliners" app_setting, and check the relevant existing flatliners.', ) @patch("openstef.model.serializer.MLflowSerializer.save_model") From a2ae736e926a964e747230b44f130ed4ea94cea1 Mon Sep 17 00:00:00 2001 From: Bart Pleiter Date: Mon, 11 Dec 2023 08:53:21 +0100 Subject: [PATCH 2/6] Update openstef/tasks/create_forecast.py Co-authored-by: Martijn Cazemier <37078892+MartijnCa@users.noreply.github.com> Signed-off-by: Bart Pleiter --- openstef/tasks/create_forecast.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openstef/tasks/create_forecast.py b/openstef/tasks/create_forecast.py index 625866519..73d43f8c6 100644 --- a/openstef/tasks/create_forecast.py +++ b/openstef/tasks/create_forecast.py @@ -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, and check the relevant existing flatliners.' + "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( From cdb19febd150844849ebcfe0b55f4f2923dfb5ba Mon Sep 17 00:00:00 2001 From: Bart Pleiter Date: Mon, 11 Dec 2023 08:53:29 +0100 Subject: [PATCH 3/6] Update openstef/tasks/train_model.py Co-authored-by: Martijn Cazemier <37078892+MartijnCa@users.noreply.github.com> Signed-off-by: Bart Pleiter --- openstef/tasks/train_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openstef/tasks/train_model.py b/openstef/tasks/train_model.py index b2d972072..6dc421221 100644 --- a/openstef/tasks/train_model.py +++ b/openstef/tasks/train_model.py @@ -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, and check the relevant existing flatliners.' + "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 7c9398d6d1ee8a6bc3e572a4304067b475e979b6 Mon Sep 17 00:00:00 2001 From: Bart Pleiter Date: Mon, 11 Dec 2023 08:53:33 +0100 Subject: [PATCH 4/6] Update test/unit/tasks/test_create_forecast.py Co-authored-by: Martijn Cazemier <37078892+MartijnCa@users.noreply.github.com> Signed-off-by: Bart Pleiter --- test/unit/tasks/test_create_forecast.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/tasks/test_create_forecast.py b/test/unit/tasks/test_create_forecast.py index cb85f1529..29eb66eed 100644 --- a/test/unit/tasks/test_create_forecast.py +++ b/test/unit/tasks/test_create_forecast.py @@ -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, and check the relevant existing flatliners.' + == "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( From 2f681c04ddd21eae19687988c9c0740ffde4d4af Mon Sep 17 00:00:00 2001 From: Bart Pleiter Date: Mon, 11 Dec 2023 08:53:47 +0100 Subject: [PATCH 5/6] Update test/unit/tasks/test_train_model.py Co-authored-by: Martijn Cazemier <37078892+MartijnCa@users.noreply.github.com> Signed-off-by: Bart Pleiter --- test/unit/tasks/test_train_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/tasks/test_train_model.py b/test/unit/tasks/test_train_model.py index 346404f68..912845d1d 100644 --- a/test/unit/tasks/test_train_model.py +++ b/test/unit/tasks/test_train_model.py @@ -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, and check the relevant existing flatliners.', + "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") From 531c7d3bc4619fc560b0c7fb5cf054c912a9e3f9 Mon Sep 17 00:00:00 2001 From: Bart Pleiter Date: Mon, 11 Dec 2023 08:58:10 +0100 Subject: [PATCH 6/6] Format. Signed-off-by: Bart Pleiter --- openstef/tasks/create_forecast.py | 2 +- openstef/tasks/train_model.py | 2 +- test/unit/tasks/test_create_forecast.py | 2 +- test/unit/tasks/test_train_model.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openstef/tasks/create_forecast.py b/openstef/tasks/create_forecast.py index 73d43f8c6..882884ae4 100644 --- a/openstef/tasks/create_forecast.py +++ b/openstef/tasks/create_forecast.py @@ -97,7 +97,7 @@ def create_forecast_task(pj: PredictionJobDataClass, context: TaskContext) -> No return elif isinstance(e, InputDataOngoingZeroFlatlinerError): raise InputDataOngoingZeroFlatlinerError( - "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." + '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( diff --git a/openstef/tasks/train_model.py b/openstef/tasks/train_model.py index 6dc421221..e13d619ee 100644 --- a/openstef/tasks/train_model.py +++ b/openstef/tasks/train_model.py @@ -165,7 +165,7 @@ def train_model_task( return else: raise InputDataOngoingZeroFlatlinerError( - "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." + '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.' ) diff --git a/test/unit/tasks/test_create_forecast.py b/test/unit/tasks/test_create_forecast.py index 29eb66eed..eb0b59d0c 100644 --- a/test/unit/tasks/test_create_forecast.py +++ b/test/unit/tasks/test_create_forecast.py @@ -157,7 +157,7 @@ def test_create_forecast_unexpected_zero_flatliner(self): assert ( e.value.args[0] - == "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."``` + == '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( diff --git a/test/unit/tasks/test_train_model.py b/test/unit/tasks/test_train_model.py index 912845d1d..12a81c67b 100644 --- a/test/unit/tasks/test_train_model.py +++ b/test/unit/tasks/test_train_model.py @@ -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. 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.", + '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")