Skip to content

Commit

Permalink
Remove content
Browse files Browse the repository at this point in the history
  • Loading branch information
atharva-2001 committed Nov 11, 2024
1 parent 45bdd32 commit e64ea66
Showing 1 changed file with 9 additions and 27 deletions.
36 changes: 9 additions & 27 deletions tardis/simulation/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,33 +625,15 @@ def log_plasma_state(
plasma_state_log["next_w"] = next_dilution_factor
plasma_state_log.columns.name = "Shell No."

if is_notebook():
logger.info("\n\tPlasma stratification:")

# Displaying the DataFrame only when the logging level is NOTSET, DEBUG or INFO
if logger.level <= logging.INFO:
if not logger.filters:
display(
plasma_state_log.iloc[::log_sampling].style.format(
"{:.3g}"
)
)
elif logger.filters[0].log_level == 20:
display(
plasma_state_log.iloc[::log_sampling].style.format(
"{:.3g}"
)
)
else:
output_df = ""
plasma_output = plasma_state_log.iloc[::log_sampling].to_string(
float_format=lambda x: f"{x:.3g}",
justify="center",
)
for value in plasma_output.split("\n"):
output_df = output_df + f"\t{value}\n"
logger.info("\n\tPlasma stratification:")
logger.info(f"\n{output_df}")
output_df = ""
plasma_output = plasma_state_log.iloc[::log_sampling].to_string(
float_format=lambda x: f"{x:.3g}",
justify="center",
)
for value in plasma_output.split("\n"):
output_df = output_df + f"\t{value}\n"
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 e64ea66

Please sign in to comment.