From a07a4cbae22a3fc0d0e6561acb3242a1f9714d1b Mon Sep 17 00:00:00 2001 From: Hannes Hansen Date: Tue, 18 Jun 2024 11:38:48 +0200 Subject: [PATCH] fixed curve output --- algo/curve_anomaly/cont_det/cont_detector.py | 4 ++-- algo/curve_anomaly/cont_det/online_detector.py | 9 +++++++-- algo/operator.py | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/algo/curve_anomaly/cont_det/cont_detector.py b/algo/curve_anomaly/cont_det/cont_detector.py index 7d0924a..78d12a9 100644 --- a/algo/curve_anomaly/cont_det/cont_detector.py +++ b/algo/curve_anomaly/cont_det/cont_detector.py @@ -43,8 +43,8 @@ def create_result(self, message, value, sub_type): "message": message, "value": value, "original_reconstructed_curves": df_smooth_and_reconstr.reset_index().to_json(orient="values"), - "start_time": df_smooth_and_reconstr.index[0], - "end_time": df_smooth_and_reconstr.index[-1] + "start_time": df_smooth_and_reconstr.index[0].isoformat(), + "end_time": df_smooth_and_reconstr.index[-1].isoformat() } def save(self): diff --git a/algo/curve_anomaly/cont_det/online_detector.py b/algo/curve_anomaly/cont_det/online_detector.py index 7cf014b..bb1c2cb 100644 --- a/algo/curve_anomaly/cont_det/online_detector.py +++ b/algo/curve_anomaly/cont_det/online_detector.py @@ -123,8 +123,13 @@ def start_training(self, timestamp): "time_range_value": "1", "time_range_level": "d" }, - "toolbox_version": "v2.2.62", - "ray_image": "ghcr.io/senergy-platform/ray:v0.0.8" + "toolbox_version": "v2.2.68", + "ray_image": "ghcr.io/senergy-platform/ray:v0.0.8", + "ray_version": "2.0.9", # must be the same as in the image + "cluster": { + "number_workers": 1, + "cpu_worker_limit": 2 + } } util.logger.debug(f"Start online training") res = requests.post(self.ml_trainer_url + "/mlfit", json=job_request) diff --git a/algo/operator.py b/algo/operator.py index 8d22dbe..b012368 100644 --- a/algo/operator.py +++ b/algo/operator.py @@ -79,7 +79,7 @@ def init(self, *args, **kwargs): if not os.path.exists(self.config.data_path): os.mkdir(self.config.data_path) - self.produce = lambda x: print(x) + self.produce = lambda x: print(x) # TODO REMOVE!!!! self.init_phase_duration = pd.Timedelta(self.config.init_phase_length, self.config.init_phase_level) self.operator_start_time = pd.Timestamp(setup_operator_starttime(self.config.data_path)).tz_localize(None)