Skip to content

Commit

Permalink
Adding setting printout in jobs logs (#130)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
FaroutYLq and pre-commit-ci[bot] authored Apr 23, 2024
1 parent 249b23e commit 0df6733
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions jobs/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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
Expand All @@ -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.")

Expand All @@ -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.")

Expand Down

0 comments on commit 0df6733

Please sign in to comment.