diff --git a/src/perovskite_solar_cell_database/composition.py b/src/perovskite_solar_cell_database/composition.py index 5b9a625..abeb82e 100644 --- a/src/perovskite_solar_cell_database/composition.py +++ b/src/perovskite_solar_cell_database/composition.py @@ -145,7 +145,8 @@ def to_topology_system(self) -> System: Returns: System: The system object. """ - atoms=optimize_molecule(self.smiles) + ase_atoms = optimize_molecule(self.smiles) + atoms = nomad_atoms_from_ase_atoms(ase_atoms) structural_type = 'molecule' if len(atoms) == 1: structural_type = 'atom' @@ -851,7 +852,7 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None: # topology contains an extra parent if len(sub_systems) == len(material.topology) - 1: - for i in range(len(self.ions)): + for i in range(len(sub_systems)): material.topology[i + 1].chemical_formula_descriptive = self.ions[ i ].name