3
3
from ase .calculators .vasp import Vasp
4
4
from ase .spacegroup import get_spacegroup
5
5
from ase import Atoms
6
- from ase .io import read , write
6
+ from ase .io import read
7
7
from scipy .spatial .distance import cdist
8
8
import numpy as np
9
9
@@ -18,7 +18,7 @@ def validate_atoms(atoms: Atoms) -> bool:
18
18
19
19
def is_diatomic (atoms : Atoms ) -> bool :
20
20
"""Checks if an atoms object is diatomic"""
21
- if validate_atoms (atoms ) == False :
21
+ if validate_atoms (atoms ) is False :
22
22
raise ValueError ("Invalid atoms object" )
23
23
if len (atoms ) == 2 :
24
24
return True
@@ -28,7 +28,7 @@ def is_diatomic(atoms: Atoms) -> bool:
28
28
29
29
def get_adjacency_matrix (atoms : Atoms ) -> np .ndarray :
30
30
"""Gets the adjacency matrix of a structure"""
31
- if validate_atoms (atoms ) == False :
31
+ if validate_atoms (atoms ) is False :
32
32
raise ValueError ("Invalid atoms object" )
33
33
# get the positions of the atoms object
34
34
positions = atoms .get_positions ()
@@ -93,7 +93,7 @@ def conflicting_atoms(atoms: Atoms, min_dist: float) -> dict:
93
93
indices , bond_lengths = analyze_adjacency_matrix (neighbor_list , min_dist )
94
94
element_list : tuple [np .ndarray ] = atoms .get_chemical_symbols ()
95
95
96
- if indices == None or len (indices ) == 0 :
96
+ if indices is None or len (indices ) == 0 :
97
97
return None
98
98
99
99
print (indices )
@@ -107,7 +107,7 @@ def conflicting_atoms(atoms: Atoms, min_dist: float) -> dict:
107
107
108
108
def print_conflicts (conflicts : dict ):
109
109
"""Prints the conflicting atoms"""
110
- if conflicts == None :
110
+ if conflicts is None :
111
111
print ("No conflicting atoms" )
112
112
else :
113
113
print ("Atom pair Bond length" )
@@ -119,7 +119,6 @@ def print_conflicts(conflicts: dict):
119
119
120
120
def check_convergence (file : str = "./vasprun.xml" ) -> list [bool ]:
121
121
"""Looks for vasprun.xml file and checks if converged"""
122
- import os
123
122
124
123
# import Vasprun from pymatgen
125
124
from pymatgen .io .vasp .outputs import Vasprun
@@ -211,7 +210,6 @@ def get_converged(args):
211
210
212
211
def get_equivalent_positions (pmg_structure ):
213
212
"""Get the equivalent positions of a structure"""
214
- from pymatgen .core .structure import Structure
215
213
from pymatgen .symmetry .analyzer import SpacegroupAnalyzer
216
214
217
215
spacegroup = SpacegroupAnalyzer (pmg_structure )
0 commit comments