diff --git a/mace/tools/scripts_utils.py b/mace/tools/scripts_utils.py index d20e942b..f6835b6f 100644 --- a/mace/tools/scripts_utils.py +++ b/mace/tools/scripts_utils.py @@ -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 ( @@ -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 ( @@ -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 ( @@ -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 ( @@ -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