Skip to content

Commit

Permalink
format result table too
Browse files Browse the repository at this point in the history
  • Loading branch information
Alin Marin Elena committed Nov 10, 2024
1 parent e85daf3 commit 9cea964
Showing 1 changed file with 37 additions and 37 deletions.
74 changes: 37 additions & 37 deletions mace/tools/scripts_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,18 +787,18 @@ def create_error_table(
table.add_row(
[
name,
f"{metrics['rmse_e'] * 1000:8.1f}",
f"{metrics['rmse_f'] * 1000:8.1f}",
f"{metrics['rel_rmse_f']:8.2f}",
f"{metrics['rmse_e'] * 1000:.4g}",
f"{metrics['rmse_f'] * 1000:.4g}",
f"{metrics['rel_rmse_f']:.4g}",
]
)
elif table_type == "PerAtomRMSE":
table.add_row(
[
name,
f"{metrics['rmse_e_per_atom'] * 1000:8.1f}",
f"{metrics['rmse_f'] * 1000:8.1f}",
f"{metrics['rel_rmse_f']:8.2f}",
f"{metrics['rmse_e_per_atom'] * 1000:.4g}",
f"{metrics['rmse_f'] * 1000:.4g}}",
f"{metrics['rel_rmse_f']:.4g}",
]
)
elif (
Expand All @@ -808,10 +808,10 @@ def create_error_table(
table.add_row(
[
name,
f"{metrics['rmse_e_per_atom'] * 1000:8.1f}",
f"{metrics['rmse_f'] * 1000:8.1f}",
f"{metrics['rel_rmse_f']:8.2f}",
f"{metrics['rmse_stress'] * 1000:8.1f}",
f"{metrics['rmse_e_per_atom'] * 1000:.4g}",
f"{metrics['rmse_f'] * 1000:.4g}",
f"{metrics['rel_rmse_f']:.4g}",
f"{metrics['rmse_stress'] * 1000:.4g}",
]
)
elif (
Expand All @@ -821,10 +821,10 @@ def create_error_table(
table.add_row(
[
name,
f"{metrics['rmse_e_per_atom'] * 1000:8.1f}",
f"{metrics['rmse_f'] * 1000:8.1f}",
f"{metrics['rel_rmse_f']:8.2f}",
f"{metrics['rmse_virials'] * 1000:8.1f}",
f"{metrics['rmse_e_per_atom'] * 1000:.4g}",
f"{metrics['rmse_f'] * 1000:.4g}",
f"{metrics['rel_rmse_f']:.4g}",
f"{metrics['rmse_virials'] * 1000:.4g}",
]
)
elif (
Expand All @@ -834,10 +834,10 @@ def create_error_table(
table.add_row(
[
name,
f"{metrics['mae_e_per_atom'] * 1000:8.1f}",
f"{metrics['mae_f'] * 1000:8.1f}",
f"{metrics['rel_mae_f']:8.2f}",
f"{metrics['mae_stress'] * 1000:8.1f}",
f"{metrics['mae_e_per_atom'] * 1000:.4g}",
f"{metrics['mae_f'] * 1000:.4g}",
f"{metrics['rel_mae_f']:.4g}",
f"{metrics['mae_stress'] * 1000:.4g}",
]
)
elif (
Expand All @@ -847,55 +847,55 @@ def create_error_table(
table.add_row(
[
name,
f"{metrics['mae_e_per_atom'] * 1000:8.1f}",
f"{metrics['mae_f'] * 1000:8.1f}",
f"{metrics['rel_mae_f']:8.2f}",
f"{metrics['mae_virials'] * 1000:8.1f}",
f"{metrics['mae_e_per_atom'] * 1000:.4g}",
f"{metrics['mae_f'] * 1000:.4g}",
f"{metrics['rel_mae_f']:.4g}",
f"{metrics['mae_virials'] * 1000:.4g}",
]
)
elif table_type == "TotalMAE":
table.add_row(
[
name,
f"{metrics['mae_e'] * 1000:8.1f}",
f"{metrics['mae_f'] * 1000:8.1f}",
f"{metrics['rel_mae_f']:8.2f}",
f"{metrics['mae_e'] * 1000:.4g}",
f"{metrics['mae_f'] * 1000:.4g}",
f"{metrics['rel_mae_f']:.4g}",
]
)
elif table_type == "PerAtomMAE":
table.add_row(
[
name,
f"{metrics['mae_e_per_atom'] * 1000:8.1f}",
f"{metrics['mae_f'] * 1000:8.1f}",
f"{metrics['rel_mae_f']:8.2f}",
f"{metrics['mae_e_per_atom'] * 1000:.4g}",
f"{metrics['mae_f'] * 1000:.4g}",
f"{metrics['rel_mae_f']:.4g}",
]
)
elif table_type == "DipoleRMSE":
table.add_row(
[
name,
f"{metrics['rmse_mu_per_atom'] * 1000:8.2f}",
f"{metrics['rel_rmse_mu']:8.1f}",
f"{metrics['rmse_mu_per_atom'] * 1000:.4g}",
f"{metrics['rel_rmse_mu']:.4g}",
]
)
elif table_type == "DipoleMAE":
table.add_row(
[
name,
f"{metrics['mae_mu_per_atom'] * 1000:8.2f}",
f"{metrics['rel_mae_mu']:8.1f}",
f"{metrics['mae_mu_per_atom'] * 1000:.4g}",
f"{metrics['rel_mae_mu']:.4g}",
]
)
elif table_type == "EnergyDipoleRMSE":
table.add_row(
[
name,
f"{metrics['rmse_e_per_atom'] * 1000:8.1f}",
f"{metrics['rmse_f'] * 1000:8.1f}",
f"{metrics['rel_rmse_f']:8.1f}",
f"{metrics['rmse_mu_per_atom'] * 1000:8.1f}",
f"{metrics['rel_rmse_mu']:8.1f}",
f"{metrics['rmse_e_per_atom'] * 1000:.4g}",
f"{metrics['rmse_f'] * 1000:.4g}",
f"{metrics['rel_rmse_f']:.4g}",
f"{metrics['rmse_mu_per_atom'] * 1000:.4g}",
f"{metrics['rel_rmse_mu']:.4g}",
]
)
return table
Expand Down

0 comments on commit 9cea964

Please sign in to comment.