From df2d16b5cec71da5bcbdb61c5b38cc09965e7038 Mon Sep 17 00:00:00 2001 From: Thomas Warford Date: Sun, 26 Jan 2025 13:15:31 +0100 Subject: [PATCH 1/2] make atomic_energies_dict Dict[int, float] --- mace/data/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mace/data/utils.py b/mace/data/utils.py index 59b868ed..cf6bb31f 100644 --- a/mace/data/utils.py +++ b/mace/data/utils.py @@ -269,16 +269,17 @@ def load_from_xyz( len(atoms) == 1 and atoms.info.get("config_type") == "IsolatedAtom" ) if isolated_atom_config: + atomic_number = int(atoms.get_atomic_numbers()[0]) if energy_key in atoms.info.keys(): - atomic_energies_dict[atoms.get_atomic_numbers()[0]] = atoms.info[ + atomic_energies_dict[atomic_number] = float(atoms.info[ energy_key - ] + ]) else: logging.warning( f"Configuration '{idx}' is marked as 'IsolatedAtom' " "but does not contain an energy. Zero energy will be used." ) - atomic_energies_dict[atoms.get_atomic_numbers()[0]] = np.zeros(1) + atomic_energies_dict[atomic_number] = 0.0 else: atoms_without_iso_atoms.append(atoms) From e157d3a25f7b2f9768960acd41972d96b0669d25 Mon Sep 17 00:00:00 2001 From: Thomas Warford Date: Sun, 26 Jan 2025 13:18:02 +0100 Subject: [PATCH 2/2] Save atomic_numbers as integer list --- mace/cli/preprocess_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mace/cli/preprocess_data.py b/mace/cli/preprocess_data.py index ef9f1343..4c2cdafd 100644 --- a/mace/cli/preprocess_data.py +++ b/mace/cli/preprocess_data.py @@ -240,7 +240,7 @@ def run(args: argparse.Namespace): "avg_num_neighbors": avg_num_neighbors, "mean": mean, "std": std, - "atomic_numbers": str(z_table.zs), + "atomic_numbers": str([int(z) for z in z_table.zs]), "r_max": args.r_max, }