diff --git a/megnet/data/graph.py b/megnet/data/graph.py index 2f56129f3..3b84b2f90 100644 --- a/megnet/data/graph.py +++ b/megnet/data/graph.py @@ -84,8 +84,8 @@ def convert(self, structure: Structure, state_attributes: List = None) -> Dict: structure: (pymatgen structure) (dictionary) """ - state_attributes = state_attributes or getattr(structure, 'state', None) or np.array([[0.0, 0.0]], - dtype='float32') + state_attributes = state_attributes or getattr(structure, 'state', None) or \ + np.array([[0.0, 0.0]], dtype='float32') index1 = [] index2 = [] bonds = [] @@ -96,7 +96,6 @@ def convert(self, structure: Structure, state_attributes: List = None) -> Dict: for neighbor in neighbors: index2.append(neighbor['site_index']) bonds.append(neighbor['weight']) - atoms = self.get_atom_features(structure) if np.size(np.unique(index1)) < len(atoms): raise RuntimeError("Isolated atoms found in the structure")