Skip to content

Commit

Permalink
Stricter pylint cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezra Peisach committed May 19, 2024
1 parent 7beb434 commit 8e38f51
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 34 deletions.
13 changes: 1 addition & 12 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,7 @@ confidence=
# no Warning level messages displayed, use "--disable=all --enable=classes
# --disable=W".
disable=missing-docstring,
empty-docstring,
raw-checker-failed,
bad-inline-option,
locally-disabled,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
use-symbolic-message-instead,
broad-except,
unspecified-encoding,
raise-missing-from

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down Expand Up @@ -115,7 +104,7 @@ max-nested-blocks=5
# inconsistent-return-statements if a never returning function is called then
# it will be considered as an explicit return statement and no message will be
# printed.
never-returning-functions=sys.exit
#never-returning-functions=sys.exit


[LOGGING]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
--extra-index-url https://pypi.anaconda.org/OpenEye/simple
OpenEye-toolkits
OpenEye-toolkits~=2022.1.1
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
universal=1

[metadata]
description-file = README.md
description_file = README.md

2 changes: 1 addition & 1 deletion wwpdb/utils/tests_oe_util/OeAlignDepictTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def testMCSAlignPairDepict(self):
"""Test case - Simple pairwise MCSS alignment - Each aligned pair output to a separate image file"""
self.__lfh.write("\nStarting OeAlignDepictTests tstMCSalignPairDepict\n")
try:
oed = OeDepictMCSAlign(verbose=self.__verbose, log=self.__lfh)
oed = OeDepictMCSAlign(verbose=self.__verbose, log=self.__lfh) # pylint: disable=possibly-used-before-assignment
oed.setRefId(self.__refId, cachePath=self.__topCachePath)
for fitId in self.__idList:
oed.setFitId(fitId, cachePath=self.__topCachePath)
Expand Down
1 change: 1 addition & 0 deletions wwpdb/utils/tests_oe_util/OeAlignDepictUtilsTests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pylint: disable=possibly-used-before-assignment
##
# File: OeAlignDepictUtilsTests.py
# Author: jdw
Expand Down
1 change: 1 addition & 0 deletions wwpdb/utils/tests_oe_util/OeBirdAltDepictTests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pylint: disable=possibly-used-before-assignment
##
#
# File: OeBirdAltDepictTests.py
Expand Down
2 changes: 1 addition & 1 deletion wwpdb/utils/tests_oe_util/OeBirdDepictTests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
##
# pylint: disable=possibly-used-before-assignment##
#
# File: OeBirdDepictTests.py
# Author: jdw
Expand Down
3 changes: 2 additions & 1 deletion wwpdb/utils/tests_oe_util/OeBuildModelMolTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def testBuildFromModel(self):
"""Test case - build OE molecule from model instance"""
self.__lfh.write("\nStarting OeBuildModelMolTests testBuildFromModel\n")
try:
oem = OeBuildModelMol(verbose=self.__verbose, log=self.__lfh)
oem = OeBuildModelMol(verbose=self.__verbose, log=self.__lfh) # pylint: disable=possibly-used-before-assignment

modelId = oem.setChemCompModelPath(self.__modelFilePath)
self.__lfh.write("Model = %s\n" % modelId)
oem.build3D()
Expand Down
4 changes: 2 additions & 2 deletions wwpdb/utils/tests_oe_util/OeBuildMolTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def testBuildMolFromSDF(self):
"""Test case - read a test SDF file and build the corresponding OEGraphMol"""
self.__lfh.write("\nStarting OeBuildMolTests testBuildolFromSDF\n")
try:
oem = OeBuildMol(verbose=self.__verbose, log=self.__lfh)
oem = OeBuildMol(verbose=self.__verbose, log=self.__lfh) # pylint: disable=possibly-used-before-assignment
if oem.importFile(self.__sdfFilePath, type="3D"):
self.__lfh.write("Title = %s\n" % oem.getTitle())
self.__lfh.write("SMILES (canonical) = %s\n" % oem.getCanSMILES())
Expand All @@ -77,7 +77,7 @@ def testBuildFromFiles(self):
try:
oem = OeBuildMol(verbose=self.__verbose, log=self.__lfh)
for pth in self.__pathList:
myReader = PdbxIoAdapter(self.__verbose, self.__lfh)
myReader = PdbxIoAdapter(self.__verbose, self.__lfh) # pylint: disable=possibly-used-before-assignment
ok = myReader.read(pdbxFilePath=pth)
self.assertTrue(ok)
# myReader.write(pdbxFilePath="TMP.cif")
Expand Down
2 changes: 1 addition & 1 deletion wwpdb/utils/tests_oe_util/OeChemCompIoUtilsTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def testMakeFromFiles(self):
self.__lfh.write("\nStarting OeChemCompIoUtilsTests testMakeFromFiles\n")
try:
oemList = []
oeU = OeChemCompIoUtils(topCachePath=self.__topCachePath, verbose=self.__verbose, log=self.__lfh)
oeU = OeChemCompIoUtils(topCachePath=self.__topCachePath, verbose=self.__verbose, log=self.__lfh) # pylint: disable=possibly-used-before-assignment
oemList = oeU.getFromPathList(self.__pathList, use3D=True, coordType="model")
for oem in oemList:
self.__lfh.write("Title = %s\n" % oem.getTitle())
Expand Down
1 change: 1 addition & 0 deletions wwpdb/utils/tests_oe_util/OeDepictTests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pylint: disable=possibly-used-before-assignment
##
#
# File: OeDepictTests.py
Expand Down
3 changes: 2 additions & 1 deletion wwpdb/utils/tests_oe_util/OeDescriptorUtilsTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def testSmilesConvert(self):
logger.info("Starting")
startTime = time.time()
try:
oedu = OeDescriptorUtils()
oedu = OeDescriptorUtils() # pylint: disable=possibly-used-before-assignment

for smiles in self.__gtpSmilesList:
smiIso = oedu.standardizeSmiles(smiles, type="ISOMERIC")
smiCan = oedu.standardizeSmiles(smiles, type="CANNONICAL")
Expand Down
3 changes: 2 additions & 1 deletion wwpdb/utils/tests_oe_util/OeMCSSTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def testMCSAlignPairDepict(self):
"""Test case - Simple pairwise MCSS alignment - Each aligned pair output to a separate image file"""
self.__lfh.write("\nStarting OeAlignDepictTests testMCSAlignPairDepict\n")
try:
oed = OeDepictMCSAlign(verbose=self.__verbose, log=self.__lfh)
oed = OeDepictMCSAlign(verbose=self.__verbose, log=self.__lfh) # pylint: disable=possibly-used-before-assignment

oed.setRefId(self.__refId, cachePath=self.__topCachePath)
for fitId in self.__idList:
oed.setFitId(fitId, cachePath=self.__topCachePath)
Expand Down
20 changes: 10 additions & 10 deletions wwpdb/utils/tests_oe_util/OePersistFullDictTests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pylint: disable=possibly-used-before-assignment
##
#
# File: OePersistFullDictTests.py
Expand Down Expand Up @@ -332,7 +333,7 @@ def testFetchOne(self):
def suiteCreateStoreCC():
suiteSelect = unittest.TestSuite()
suiteSelect.addTest(OePersistFullDictTests("testCreateChemCompStore"))
suiteSelect.addTest(OePersistFullDictTests("testUpdateChemCompStoreWithPrd"))
# suiteSelect.addTest(OePersistFullDictTests("testUpdateChemCompStoreWithPrd"))
return suiteSelect


Expand All @@ -355,7 +356,6 @@ def suiteSearchStoreOE():
suiteSelect = unittest.TestSuite()
suiteSelect.addTest(OePersistFullDictTests("testFetchAll"))
suiteSelect.addTest(OePersistFullDictTests("testFetchOne"))
suiteSelect.addTest(OePersistFullDictTests("testBoundedFormulaSearch"))
return suiteSelect


Expand All @@ -367,13 +367,13 @@ def suiteSearchStoreOE():
mySuite = suiteCreateStoreCC()
unittest.TextTestRunner(verbosity=2).run(mySuite)

if not os.access(os.path.join(testoutput, "chemcomp-index.pic"), os.F_OK):
mySuite = suiteCreateIndexCC()
unittest.TextTestRunner(verbosity=2).run(mySuite)
# if not os.access(os.path.join(testoutput, "chemcomp-index.pic"), os.F_OK):
# mySuite = suiteCreateIndexCC()
# unittest.TextTestRunner(verbosity=2).run(mySuite)

if not os.access(os.path.join(testoutput, "oe-store.db"), os.F_OK):
mySuite = suiteCreateStoreOE()
unittest.TextTestRunner(verbosity=2).run(mySuite)
# if not os.access(os.path.join(testoutput, "oe-store.db"), os.F_OK):
# mySuite = suiteCreateStoreOE()
# unittest.TextTestRunner(verbosity=2).run(mySuite)

mySuite = suiteSearchStoreOE()
unittest.TextTestRunner(verbosity=2).run(mySuite)
# mySuite = suiteSearchStoreOE()
# unittest.TextTestRunner(verbosity=2).run(mySuite)
1 change: 1 addition & 0 deletions wwpdb/utils/tests_oe_util/OePersistTests.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pylint: disable=possibly-used-before-assignment
##
#
# File: OePersistTests.py
Expand Down
5 changes: 3 additions & 2 deletions wwpdb/utils/tests_oe_util/PdbxBuildChemCompTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def __molListPrint(self, oeMolList):
self.__lfh.write("\nTitle %s = %s\n" % (oem.getCcId(), oem.getTitle()))
self.__lfh.write("Formula %s = %s\n" % (oem.getCcId(), oem.getFormula()))
self.__lfh.write("SMILES (canonical) %s = %s\n" % (oem.getCcId(), oem.getCanSMILES()))

self.__lfh.write("SMILES (isomeric) %s = %s\n" % (oem.getCcId(), oem.getIsoSMILES()))
inKy = oem.getInChIKey()
self.__lfh.write("InChIKey (std) %s = %s\n" % (oem.getCcId(), inKy))
Expand All @@ -72,13 +73,13 @@ def testBuildFromFiles(self):
try:
oemList = []

oeU = OeChemCompIoUtils(topCachePath=self.__topCachePath, verbose=self.__verbose, log=self.__lfh)
oeU = OeChemCompIoUtils(topCachePath=self.__topCachePath, verbose=self.__verbose, log=self.__lfh) # pylint: disable=possibly-used-before-assignment
oemList = oeU.getFromPathList(self.__pathList, use3D=True, coordType="model")
self.__molListPrint(oemList)
for oem in oemList:
ccId = oem.getCcId()
fp = "FF_" + ccId + ".cif"
ccB = PdbxBuildChemComp(verbose=self.__verbose, log=self.__lfh)
ccB = PdbxBuildChemComp(verbose=self.__verbose, log=self.__lfh) # pylint: disable=possibly-used-before-assignment
ccB.setOeMol(oem.getMol(), ccId, name=ccId)
ccB.write(filePath=fp)
except: # noqa: E722 pylint: disable=bare-except
Expand Down

0 comments on commit 8e38f51

Please sign in to comment.