Skip to content

Commit

Permalink
fix name and output folder
Browse files Browse the repository at this point in the history
  • Loading branch information
cfuselli committed Oct 23, 2024
1 parent 04aff68 commit e1aee4a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion amstrax/auto_processing_new/offline_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def main(args):
if args.production:
# amstrax_path will be something like /data/xenon/xams/amstrax_versioned/vTEST1
# we want to extract the last part of the path, for example vTEST1
jobname += f"_{args.amstrax_path.split('/')[-1]}_production"
jobname += f"_{args.amstrax_path.rstrip('/').split('/')[-1]}_production"

arguments = []
arguments.append(f"--run_id {run_id}")
Expand Down
14 changes: 13 additions & 1 deletion amstrax/auto_processing_new/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,24 @@ def setup_production(self):
log.info("Setting up production configurations.")

# Set the output folder to the production folder
if self.output_folder:
if self.output_folder is not None:
raise ValueError("Output folder should not be set when processing production data.")

self.output_folder = self.amstrax.get_xams_config("xams_processed")
log.info(f"Output folder set to {self.output_folder}")

# Make sure we specified corrections version
if not self.corrections_version:
raise ValueError("Corrections version should be specified for production processing.")

# make sure that amstrax_path contains amstrax_versioned
if "amstrax_versioned" not in self.amstrax_path:
raise ValueError("amstrax_path should be from amstrax_versioned for production processing.")

# only xamsdata user can process production data
if getpass.getuser() != "xamsdata":
raise PermissionError("Only xamsdata user can process production data.")


def add_data_entry(self, data_type, location, **info):
"""
Expand Down

0 comments on commit e1aee4a

Please sign in to comment.