Skip to content

Commit

Permalink
Added some more formatting changes to other logging messages for cons…
Browse files Browse the repository at this point in the history
…istency
  • Loading branch information
DhruvSondhi committed Jun 15, 2021
1 parent 941b956 commit c8ee1ef
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tardis/io/atom_data/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ def from_hdf(cls, fname=None):
# ToDo: strore data sources as attributes in carsus

logger.info(
f"Read Atom Data with UUID={atom_data.uuid1} and MD5={atom_data.md5}."
f"\n\tReading Atom Data with:\n\tUUID = {atom_data.uuid1}\n\tMD5 = {atom_data.md5}. "
)
if nonavailable:
logger.info(
f'Non provided atomic data: {", ".join(nonavailable)}'
f'\n\tNon provided atomic data:\n\t{", ".join(nonavailable)}'
)

return atom_data
Expand Down
2 changes: 1 addition & 1 deletion tardis/io/atom_data/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def resolve_atom_data_fname(fname):
fpath = os.path.join(os.path.join(get_data_dir(), fname))
if os.path.exists(fpath):
logger.info(
f"Atom Data {fname} not found in local path. Exists in TARDIS Data repo {fpath}"
f"\n\tAtom Data {fname} not found in local path.\n\tExists in TARDIS Data repo {fpath}"
)
return fpath

Expand Down
2 changes: 1 addition & 1 deletion tardis/plasma/standard_plasmas.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def assemble_plasma(config, model, atom_data=None):
else:
raise ValueError("No atom_data option found in the configuration.")

logger.info("Reading Atomic Data from %s", atom_data_fname)
logger.info(f"\n\tReading Atomic Data from {atom_data_fname}")

try:
atom_data = AtomData.from_hdf(atom_data_fname)
Expand Down
8 changes: 5 additions & 3 deletions tardis/simulation/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def log_plasma_state(
plasma_state_log.columns.name = "Shell No."

if check_simulation_env():
logger.info(f"\n\tPlasma stratification:")
logger.info("\n\tPlasma stratification:")
logger.info(
display(
plasma_state_log.iloc[::log_sampling].style.format("{:.3g}")
Expand All @@ -436,11 +436,13 @@ def log_plasma_state(
else:
output_df = ""
plasma_output = plasma_state_log.iloc[::log_sampling].to_string(
float_format=lambda x: "{:.3g}".format(x), justify="center",
float_format=lambda x: "{:.3g}".format(x),
justify="center",
)
for value in plasma_output.split("\n"):
output_df = output_df + "\t{}\n".format(value)
logger.info(f"\n\tPlasma stratification:\n\n{output_df}")
logger.info("\n\tPlasma stratification:")
logger.info(f"\n{output_df}")

logger.info(
f"\n\tCurrent t_inner = {t_inner:.3f}\n\tExpected t_inner for next iteration = {next_t_inner:.3f}\n"
Expand Down

0 comments on commit c8ee1ef

Please sign in to comment.