From 0df673396012f84d5e7c849e1737d49acbfd256f Mon Sep 17 00:00:00 2001 From: Lanqing Yuan Date: Tue, 23 Apr 2024 17:27:24 -0500 Subject: [PATCH] Adding setting printout in jobs logs (#130) * adding en_range for instr_file_name * placeholder en_range * adding en_range * debug name * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * printing settings * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- jobs/job.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/jobs/job.py b/jobs/job.py index 01b1baa..418414c 100644 --- a/jobs/job.py +++ b/jobs/job.py @@ -71,6 +71,15 @@ def load_config(): return settings +def print_settings(settings): + """Print the settings in a table format.""" + logging.info("====================================") + logging.info("Settings:") + for k, v in settings.items(): + logging.info(f"{k}: {v}") + logging.info("====================================") + + def parse_en_range(en_range_str): """Parse the energy range string and return a tuple of floats.""" if en_range_str.strip(): @@ -181,6 +190,7 @@ def main(): settings = load_config() st = create_context(settings, runid) data_types = get_data_types(settings) + print_settings(settings) process_data_types(st, str(runid).zfill(6), data_types) # Process data-only mode if required @@ -190,6 +200,7 @@ def main(): settings_temp = settings.copy() settings_temp["saltax_mode"] = "data" st_data = create_context(settings_temp, runid) + print_settings(settings_temp) process_data_types(st_data, str(runid).zfill(6), data_types) logging.info("Finished processing for data-only mode.") @@ -200,6 +211,7 @@ def main(): settings_temp = settings.copy() settings_temp["saltax_mode"] = "simu" st_simu = create_context(settings_temp, runid) + print_settings(settings_temp) process_data_types(st_simu, str(runid).zfill(6), data_types) logging.info("Finished processing for simu-only mode.")