2929os .environ ['DJ_SUPPORT_FILEPATH_MANAGEMENT' ] = "TRUE"
3030dj .config ['safemode' ] = False
3131
32- store_directory = pathlib .Path (dj .config ['stores' ]['report_store' ]['stage' ])
32+ store_stage = pathlib .Path (dj .config ['stores' ]['report_store' ]['stage' ])
33+
34+ if dj .config ['stores' ]['report_store' ]['protocol' ] == 's3' :
35+ store_location = (pathlib .Path (dj .config ['stores' ]['report_store' ]['bucket' ])
36+ / pathlib .Path (dj .config ['stores' ]['report_store' ]['location' ]))
37+ store_location = 'S3: ' + str (store_location )
38+ else :
39+ store_location = pathlib .Path (dj .config ['stores' ]['report_store' ]['location' ])
3340
3441mpl .rcParams ['font.size' ] = 16
3542
@@ -49,7 +56,7 @@ class SessionLevelReport(dj.Computed):
4956
5057 def make (self , key ):
5158 water_res_num , sess_date = get_wr_sessdate (key )
52- sess_dir = store_directory / water_res_num / sess_date
59+ sess_dir = store_stage / water_res_num / sess_date
5360 sess_dir .mkdir (parents = True , exist_ok = True )
5461
5562 # ---- behavior_performance ----
@@ -106,7 +113,7 @@ def key_source(self):
106113
107114 def make (self , key ):
108115 water_res_num , sess_date = get_wr_sessdate (key )
109- sess_dir = store_directory / water_res_num / sess_date
116+ sess_dir = store_stage / water_res_num / sess_date
110117 sess_dir .mkdir (parents = True , exist_ok = True )
111118
112119 # ---- Setup ----
@@ -233,7 +240,7 @@ def key_source(self):
233240
234241 def make (self , key ):
235242 water_res_num , sess_date = get_wr_sessdate (key )
236- sess_dir = store_directory / water_res_num / sess_date
243+ sess_dir = store_stage / water_res_num / sess_date
237244 sess_dir .mkdir (parents = True , exist_ok = True )
238245
239246 fig1 = plt .figure (figsize = (16 , 12 ))
@@ -282,7 +289,7 @@ def key_source(self):
282289
283290 def make (self , key ):
284291 water_res_num , sess_date = get_wr_sessdate (key )
285- sess_dir = store_directory / water_res_num / sess_date / str (key ['insertion_number' ])
292+ sess_dir = store_stage / water_res_num / sess_date / str (key ['insertion_number' ])
286293 sess_dir .mkdir (parents = True , exist_ok = True )
287294
288295 probe_insertion = ephys .ProbeInsertion & key
@@ -351,7 +358,7 @@ def key_source(self):
351358
352359 def make (self , key ):
353360 water_res_num , sess_date = get_wr_sessdate (key )
354- sess_dir = store_directory / water_res_num / sess_date / str (key ['insertion_number' ])
361+ sess_dir = store_stage / water_res_num / sess_date / str (key ['insertion_number' ])
355362 sess_dir .mkdir (parents = True , exist_ok = True )
356363
357364 probe_insertion = ephys .ProbeInsertion & key
@@ -402,7 +409,7 @@ class UnitLevelReport(dj.Computed):
402409
403410 def make (self , key ):
404411 water_res_num , sess_date = get_wr_sessdate (key )
405- sess_dir = store_directory / water_res_num / sess_date / str (key ['insertion_number' ]) / 'units'
412+ sess_dir = store_stage / water_res_num / sess_date / str (key ['insertion_number' ]) / 'units'
406413 sess_dir .mkdir (parents = True , exist_ok = True )
407414
408415 fig1 = unit_psth .plot_unit_psth (key )
@@ -452,7 +459,7 @@ class ProjectLevelProbeTrack(dj.Computed):
452459 key_source = experiment .Project & 'project_name = "MAP"'
453460
454461 def make (self , key ):
455- proj_dir = store_directory
462+ proj_dir = store_stage
456463
457464 session_count = len (SessionLevelProbeTrack ())
458465
0 commit comments