Commit b156c5dda7d9fc2135fdd6405d9413db5ec8b8be

Authored by Alexis Koralewski
1 parent 13b26571
Exists in dev

Relocate sequences_pickle folder in data folder

  1 +20-03-2023 (AKo): v0.6.20.0
  2 + - Add night_id to sequences, create folder for night_id
  3 + - Change sequences_pickle location (relocate in data folder)
  4 +
1 02-03-2023 (AKo): v0.6.19.0 5 02-03-2023 (AKo): v0.6.19.0
2 - Add monitoring_names to plot on website in Pyros Config 6 - Add monitoring_names to plot on website in Pyros Config
3 - Add symbol attributes for Channels & albums in obsconfig 7 - Add symbol attributes for Channels & albums in obsconfig
@@ -10,7 +14,6 @@ @@ -10,7 +14,6 @@
10 - Rework monitoring views (weather monitoring, history and weather_config) 14 - Rework monitoring views (weather monitoring, history and weather_config)
11 - Add new version of AgentM and AgentDevicePLC 15 - Add new version of AgentM and AgentDevicePLC
12 - Fix Agent, wasn't executing agent specific commands 16 - Fix Agent, wasn't executing agent specific commands
13 - -  
14 17
15 15-02-2023 (AKo): v0.6.18.0 18 15-02-2023 (AKo): v0.6.18.0
16 - Add new version of weather config view 19 - Add new version of weather config view
src/core/pyros_django/routine_manager/functions.py
@@ -395,11 +395,13 @@ def create_sequence_pickle(sequence): @@ -395,11 +395,13 @@ def create_sequence_pickle(sequence):
395 for plan in album.plans.all(): 395 for plan in album.plans.all():
396 fullseq_dict["albums"][f"{album.name}"]["plans"].append(model_to_dict(instance=plan)) 396 fullseq_dict["albums"][f"{album.name}"]["plans"].append(model_to_dict(instance=plan))
397 period = sequence.period 397 period = sequence.period
398 - if not os.path.exists("sequences_pickle"):  
399 - os.mkdir("./sequences_pickle")  
400 - if not os.path.exists(f"sequences_pickle/P{period.id}"):  
401 - os.mkdir(f"sequences_pickle/P{period.id}")  
402 - if not os.path.exists(f"sequences_pickle/P{period.id}/{sequence.night_id}"):  
403 - os.mkdir(f"sequences_pickle/P{period.id}/{sequence.night_id}")  
404 - seq_pickle_file_name = f"./sequences_pickle/P{period.id}/{sequence.night_id}/{sequence.id}.p" 398 + root_project_path = os.environ.get("PROJECT_ROOT_PATH")
  399 + data_path = root_project_path + "/data/"
  400 + if not os.path.exists(data_path + "sequences_pickle"):
  401 + os.mkdir(data_path +"sequences_pickle")
  402 + if not os.path.exists(data_path + f"sequences_pickle/P{period.id}"):
  403 + os.mkdir(data_path + f"sequences_pickle/P{period.id}")
  404 + if not os.path.exists(data_path +f"sequences_pickle/P{period.id}/{sequence.night_id}"):
  405 + os.mkdir(data_path +f"sequences_pickle/P{period.id}/{sequence.night_id}")
  406 + seq_pickle_file_name = data_path +f"./sequences_pickle/P{period.id}/{sequence.night_id}/{sequence.id}.p"
405 pickle.dump(fullseq_dict,open(seq_pickle_file_name,"wb")) 407 pickle.dump(fullseq_dict,open(seq_pickle_file_name,"wb"))
406 \ No newline at end of file 408 \ No newline at end of file