Skip to content

Commit

Permalink
process production
Browse files Browse the repository at this point in the history
  • Loading branch information
cfuselli committed Oct 23, 2024
1 parent d6347b3 commit 04aff68
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions amstrax/auto_processing_new/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ def __init__(self, args):
log.info(f" --This file: {__file__}")
log.info(f" --Is online: {self.is_online}")


self.setup_amstrax()
self.setup_production()

def setup_amstrax(self):

if self.amstrax_path:
if not os.path.exists(self.amstrax_path):
raise FileNotFoundError(f"amstrax path {self.amstrax_path} does not exist.")
Expand All @@ -46,6 +49,19 @@ def setup_amstrax(self):

self.db_utils = self.amstrax.db_utils

def setup_production(self):

if self.production:
log.info("Setting up production configurations.")

# Set the output folder to the production folder
if self.output_folder:
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}")


def add_data_entry(self, data_type, location, **info):
"""
Add the data entry to rundb.
Expand Down Expand Up @@ -199,7 +215,6 @@ def parse_args():
def main():
args = parse_args()
processor = RunProcessor(args)
processor.setup_amstrax()
processor.process()


Expand Down

0 comments on commit 04aff68

Please sign in to comment.