Skip to content

Commit 4beb257

Browse files
committed
resolve some annoying warnings
1 parent 21b3a7f commit 4beb257

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

rmgpy/qm/gaussian.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
# #
2828
###############################################################################
2929

30-
import distutils.spawn
3130
import itertools
3231
import logging
3332
import os
3433
import re
3534
from subprocess import Popen
35+
import shutil
3636

3737
import cclib
3838

@@ -55,7 +55,7 @@ class Gaussian:
5555

5656
for exe in executablesToTry:
5757
try:
58-
executable_path = distutils.spawn.find_executable(exe)
58+
executable_path = shutil.which(exe)
5959
except:
6060
executable_path = None
6161
if executable_path is not None:

rmgpy/qm/mopac.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
# #
2828
###############################################################################
2929

30-
import distutils.spawn
3130
import logging
3231
import os
3332
import re
@@ -52,7 +51,7 @@ class Mopac(object):
5251
input_file_extension = ".mop"
5352
output_file_extension = ".out"
5453

55-
executable_path = distutils.spawn.find_executable("mopac")
54+
executable_path = shutil.which("mopac")
5655

5756
use_polar = False # use polar keyword in MOPAC
5857

test/database/databaseTest.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -463,12 +463,12 @@ def kinetics_check_surface_library_reactions_have_surface_attributes(self, libra
463463
failed = False
464464
if "_Pt" in library.label:
465465
for entry in entries:
466-
if entry.metal is not "Pt":
466+
if entry.metal != "Pt":
467467
logging.error(f"Expected {entry} metal attribute in {library} library to match Pt, but was {entry.metal}")
468468
failed = True
469469
if "_Ni" in library.label:
470470
for entry in entries:
471-
if entry.metal is not "Ni":
471+
if entry.metal != "Ni":
472472
logging.error(f"Expected {entry} metal attribute in {library} library to match Ni, but was {entry.metal}")
473473
failed = True
474474
for entry in entries:
@@ -1090,7 +1090,7 @@ def kinetics_check_cd_atom_type(self, family_name):
10901090
continue
10911091
# Create list of all the atomTypes that should be present in addition or instead of Cd
10921092
correct_atom_list = []
1093-
num_of_d_bonds = sum([1 if x.order[0] is "D" and len(x.order) == 1 else 0 for x in atom.bonds.values()])
1093+
num_of_d_bonds = sum([1 if x.order[0] == "D" and len(x.order) == 1 else 0 for x in atom.bonds.values()])
10941094
if num_of_d_bonds == 2:
10951095
correct_atom_list.append("Cdd")
10961096
elif num_of_d_bonds == 1:
@@ -1675,11 +1675,11 @@ def check_surface_thermo_groups_have_surface_attributes(self, group_name, group)
16751675
for entry in group.entries.values():
16761676
if isinstance(entry.data, rmgpy.thermo.thermodata.ThermoData):
16771677
if "Pt" in group_name:
1678-
if entry.metal is not "Pt":
1678+
if entry.metal != "Pt":
16791679
logging.error(f"Expected {entry} metal attribute in {group_name} group to match Pt, but was {entry.metal}")
16801680
failed = True
16811681
if "111" in group_name:
1682-
if entry.facet is not "111":
1682+
if entry.facet != "111":
16831683
logging.error(f"Expected {entry} facet attribute in {group_name} group to match 111, but was {entry.facet}")
16841684
failed = True
16851685
if not entry.metal:
@@ -1701,15 +1701,15 @@ def check_surface_thermo_libraries_have_surface_attributes(self, library_name, l
17011701
failed = False
17021702
for entry in library.entries.values():
17031703
if "Pt" in library_name:
1704-
if entry.metal is not "Pt":
1704+
if entry.metal != "Pt":
17051705
logging.error(f"Expected {entry} metal attribute in {library_name} library to match Pt, but was {entry.metal}")
17061706
failed = True
17071707
if "Ni" in library_name:
1708-
if entry.metal is not "Ni":
1708+
if entry.metal != "Ni":
17091709
logging.error(f"Expected {entry} metal attribute in {library_name} library to match Ni, but was {entry.metal}")
17101710
failed = True
17111711
if "111" in library_name:
1712-
if entry.facet is not "111":
1712+
if entry.facet != "111":
17131713
logging.error(f"Expected {entry} facet attribute in {library_name} library to match 111, but was {entry.facet}")
17141714
failed = True
17151715
if not entry.metal:
@@ -1929,7 +1929,7 @@ def general_check_cd_atom_type(self, group_name, group):
19291929
continue
19301930
# figure out what the correct atomtype is
19311931
correct_atom_list = []
1932-
num_of_d_bonds = sum([1 if x.order[0] is "D" and len(x.order) == 1 else 0 for x in atom.bonds.values()])
1932+
num_of_d_bonds = sum([1 if x.order[0] == "D" and len(x.order) == 1 else 0 for x in atom.bonds.values()])
19331933
if num_of_d_bonds == 2:
19341934
correct_atom_list.append("Cdd")
19351935
elif num_of_d_bonds == 1:

0 commit comments

Comments
 (0)