diff --git a/amstrax/auto_processing_new/offline_processing.py b/amstrax/auto_processing_new/offline_processing.py index e0f68c23..7623683a 100644 --- a/amstrax/auto_processing_new/offline_processing.py +++ b/amstrax/auto_processing_new/offline_processing.py @@ -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}") diff --git a/amstrax/auto_processing_new/process.py b/amstrax/auto_processing_new/process.py index 550fb538..5b519203 100644 --- a/amstrax/auto_processing_new/process.py +++ b/amstrax/auto_processing_new/process.py @@ -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): """