Skip to content

Commit d129e6f

Browse files
committed
better type comparisons
1 parent 556b7c2 commit d129e6f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vsh/scripts/slab.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ def update_structure(
7373
from sklearn.preprocessing import normalize
7474

7575
species = []
76-
if type(traj) == list:
76+
if isinstance(traj, list):
7777
for t in traj:
7878
elements = np.unique(t.get_chemical_symbols())
7979
for e in elements:
8080
if e not in species:
8181
species.append(e)
82-
elif type(traj) == Atoms:
82+
elif isinstance(traj, Atoms):
8383
elements = np.unique(traj.get_chemical_symbols())
8484
for e in elements:
8585
if e not in species:

0 commit comments

Comments
 (0)