diff --git a/mace/tools/tables_utils.py b/mace/tools/tables_utils.py index 07f41401..a5e4eb30 100644 --- a/mace/tools/tables_utils.py +++ b/mace/tools/tables_utils.py @@ -127,18 +127,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 ( @@ -148,10 +148,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 ( @@ -161,10 +161,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 ( @@ -174,10 +174,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 ( @@ -187,55 +187,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