Skip to content

Commit 7cb7357

Browse files
committed
Use proposal_path function
1 parent 7fd4195 commit 7cb7357

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

startup/01-base.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@
1616

1717
# Set ipython startup dir variable (used in some modules):
1818
PROFILE_STARTUP_PATH = os.path.abspath(get_ipython().profile_dir.startup_dir)
19+
20+
def proposal_path():
21+
return f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}"

startup/30-detectors.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ class MyDetector(SingleTrigger, AreaDetector):
152152
hdf5 = Cpt(
153153
HDF5PluginWithFileStore,
154154
suffix="HDF1:",
155-
write_path_template=f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/default/", # trailing slash!
156-
root=f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/default/",
155+
write_path_template=f"{proposal_path()}/assets/default/", # trailing slash!
156+
root=f"{proposal_path()}/assets/default/",
157157
)
158158

159159
def set_primary(self, n, value=None):
@@ -494,34 +494,34 @@ def collect_asset_docs(self) -> SyncOrAsyncIterator[Asset]:
494494
#Anal1A_Camlens.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{Anal1A_Camlens.name}/"
495495

496496
#Anal1A_Cambeam = MyDetector("XF:21IDD-BI{Anal:1A-Cam:beam}", name="Anal1A_Cambeam")
497-
#Anal1A_Cambeam.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{Anal1A_Cambeam.name}/"
497+
#Anal1A_Cambeam.hdf5.write_path_template = f"{
498498

499499
Prep2A_CamLEED = MyDetector("XF:21IDD-BI{ES-Cam:9}", name="Prep2A_CamLEED")
500-
Prep2A_CamLEED.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{Prep2A_CamLEED.name}/"
500+
Prep2A_CamLEED.hdf5.write_path_template = f"{proposal_path()}/assets/{Prep2A_CamLEED.name}/"
501501

502502
#Prep2A_Camevap1 = MyDetector("XF:21IDD-BI{Prep:2A-Cam:evap1}", name="Prep2A_Camevap1")
503-
#Prep2A_Camevap1.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{Prep2A_Camevap1.name}/"
503+
#Prep2A_Camevap1.hdf5.write_path_template = f"{proposal_path()}/assets/{Prep2A_Camevap1.name}/"
504504

505505
#Prep2A_Camevap2 = MyDetector("XF:21IDD-BI{Prep:2A-Cam:evap2}", name="Prep2A_Camevap2")
506-
#Prep2A_Camevap2.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{Prep2A_Camevap2.name}/"
506+
#Prep2A_Camevap2.hdf5.write_path_template = f"{proposal_path()}/assets/{Prep2A_Camevap2.name}/"
507507

508508
LOWT_5A_Cam1 = MyDetector("XF:21IDD-OP{ES-Cam:16}", name="LOWT_5A_Cam1")
509-
LOWT_5A_Cam1.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{LOWT_5A_Cam1.name}/"
509+
LOWT_5A_Cam1.hdf5.write_path_template = f"{proposal_path()}/assets/{LOWT_5A_Cam1.name}/"
510510

511511
#LOWT_5A_Cam2 = MyDetector("XF:21IDD-OP{LOWT:5A-Cam:2}", name="LOWT_5A_Cam2")
512-
#LOWT_5A_Cam2.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{LOWT_5A_Cam2.name}/"
512+
#LOWT_5A_Cam2.hdf5.write_path_template = f"{proposal_path()}/assets/{LOWT_5A_Cam2.name}/"
513513

514514
#BTA2_Cam1 = MyDetector("XF:21IDD-OP{BT:A2-Cam:1}", name="BTA2_Cam1")
515-
#BTA2_Cam1.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{BTA2_Cam1.name}/"
515+
#BTA2_Cam1.hdf5.write_path_template = f"{proposal_path()}/assets/{BTA2_Cam1.name}/"
516516

517517
#BTB2_Cam1 = MyDetector("XF:21IDD-OP{BT:B2-Cam:1}", name="B2BT_Cam1")
518-
#BTB2_Cam1.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{BTB2_Cam1.name}/"
518+
#BTB2_Cam1.hdf5.write_path_template = f"{proposal_path()}/assets/{BTB2_Cam1.name}/"
519519

520520
#PEEM1B_Cam1 = MyDetector("XF:21IDD-OP{PEEM:1B-Cam:1}", name="PEEM1B_Cam1")
521-
#PEEM1B_Cam1.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{PEEM1B_Cam1.name}/"
521+
#PEEM1B_Cam1.hdf5.write_path_template = f"{proposal_path()}/assets/{PEEM1B_Cam1.name}/"
522522

523523
#BTB5_Cam1 = MyDetector("XF:21IDD-OP{BT:B5-Cam:1}", name="BTB5_Cam1")
524-
#BTB5_Cam1.hdf5.write_path_template = f"/nsls2/data/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{BTB5_Cam1.name}/"
524+
#BTB5_Cam1.hdf5.write_path_template = f"{proposal_path()}/assets/{BTB5_Cam1.name}/"
525525

526526
all_standard_pros = [
527527
Diag1_CamH,

startup/46-ESM_LEEM.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class LEEMDetector(Device):
1818
# self.st = None
1919

2020
def stage(self):
21-
self.filepath.set(f"/nsls2/data3/esm/proposals/{RE.md["cycle"]}/{RE.md["data_session"]}/assets/{self.name}/")
21+
self.filepath.set(f"{proposal_path()}/assets/{self.name}/")
2222
return super().stage()
2323

2424
def trigger(self):

0 commit comments

Comments
 (0)