Skip to content

Commit

Permalink
fixed curve output
Browse files Browse the repository at this point in the history
  • Loading branch information
hahahannes committed Jun 18, 2024
1 parent 7f0751e commit a07a4cb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions algo/curve_anomaly/cont_det/cont_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
9 changes: 7 additions & 2 deletions algo/curve_anomaly/cont_det/online_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion algo/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a07a4cb

Please sign in to comment.