livctr commited on
Commit
631bbf6
·
1 Parent(s): 15c8d24

ensure_directories creates the new directories at the start

Browse files
data_pipeline/conference_scraper.py CHANGED
@@ -258,5 +258,6 @@ def stats():
258
 
259
 
260
  if __name__ == "__main__":
 
261
  main()
262
  stats()
 
258
 
259
 
260
  if __name__ == "__main__":
261
+ DataPaths.ensure_directories()
262
  main()
263
  stats()
data_pipeline/config.py CHANGED
@@ -31,15 +31,15 @@ class DataPaths:
31
  FRONTEND_ITA_PATH = os.path.join(FRONTEND_EMBD_PATH, 'id_title_author')
32
  FRONTEND_WEIGHTS_PATH = os.path.join(FRONTEND_EMBD_PATH, 'weights.pt')
33
 
34
-
35
- # create FRONTEND_DIR PROF_DIR CONFERENCE_DIR
36
 
37
  @staticmethod
38
  def ensure_directories():
39
- # Create the directories if they do not exist
40
- os.makedirs(DataPaths.RAW_DATA_DIR, exist_ok=True)
41
- os.makedirs(DataPaths.PROCESSED_DATA_DIR, exist_ok=True)
42
- os.makedirs(DataPaths.MODEL_OUTPUT_DIR, exist_ok=True)
43
-
44
- # Call this function early in your pipeline
45
- DataPaths.ensure_directories()
 
 
31
  FRONTEND_ITA_PATH = os.path.join(FRONTEND_EMBD_PATH, 'id_title_author')
32
  FRONTEND_WEIGHTS_PATH = os.path.join(FRONTEND_EMBD_PATH, 'weights.pt')
33
 
34
+ # create BASE_DIR LOG_DIR FRONTEND_DIR PROF_DIR CONFERENCE_DIR PAPER_DIR
 
35
 
36
  @staticmethod
37
  def ensure_directories():
38
+ # create BASE_DIR LOG_DIR FRONTEND_DIR PROF_DIR CONFERENCE_DIR PAPER_DIR
39
+ for directory in [DataPaths.BASE_DIR,
40
+ DataPaths.LOG_DIR,
41
+ DataPaths.FRONTEND_DIR,
42
+ DataPaths.PROF_DIR,
43
+ DataPaths.CONFERENCE_DIR,
44
+ DataPaths.PAPER_DIR]:
45
+ os.makedirs(directory, exist_ok=True)