Commit c173ca07 authored by JOSSOUD Olivier's avatar JOSSOUD Olivier
Browse files

Flow. Create "processed" subfolder if it does not exist.

parent 2ec34630
Pipeline #161778 passed with stages
in 1 minute and 33 seconds
......@@ -261,10 +261,13 @@ def get_datasets_data(dataset: DatasetReader, retrieve_iceblocks_from_processed_
encoder_df = encoder_df.drop(columns="speed_avg")
# Iceblock
iceblock_filename = os.path.join(dataset.dataset_path, "processed", "iceblocks.csv")
processed_dirname = os.path.join(dataset.dataset_path, "processed")
iceblock_filename = os.path.join(processed_dirname, "iceblocks.csv")
if retrieve_iceblocks_from_processed_csv and os.path.exists(iceblock_filename):
iceblock_df = pd.read_csv(iceblock_filename, parse_dates=["datetime_start", "datetime_end", "datetime_stacked"])
else:
if not os.path.exists(processed_dirname):
os.mkdir(processed_dirname)
iceblock_df = dataset.get_timeseries("ICBKCTRL_instant")
iceblock_df = iceblock.get_clean_iceblock_df(iceblock_df)
iceblock_df.to_csv(iceblock_filename, index=False, date_format="%Y-%m-%dT%H:%M:%SZ")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment