Skip to content

Commit

Permalink
remove Mold2 from automated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-sicho committed Jul 1, 2024
1 parent 35ad93b commit 2e1f75f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 23 deletions.
7 changes: 0 additions & 7 deletions qsprpred/extra/data/descriptors/sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,6 @@ def __init__(self, descs: list[str] | None = None):
super().__init__()
self._descs = descs
self._mold2 = Mold2_calculator()
assert os.path.exists(self._mold2._zipfile), "Mold2 binary not found"
with open(self._mold2._zipfile, "rb") as f:
content = f.read()
print(content)
# open as zip file
with zipfile.ZipFile(self._mold2._zipfile, "r") as zip_ref:
zip_ref.extractall("/tmp")
self._defaultDescs = self._mold2.calculate(
[Chem.MolFromSmiles("C")], show_banner=False
).columns.tolist()
Expand Down
16 changes: 8 additions & 8 deletions qsprpred/extra/data/descriptors/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ def setUp(self):
self.dataset = self.createSmallTestDataSet(self.__class__.__name__)
self.dataset.shuffle()

@skipIf(platform.system() == "Darwin", "Mold2 not supported on Mac OS")
def testMold2(self):
"""Test the Mold2 descriptor calculator."""
self.dataset.nJobs = 1
self.dataset.addDescriptors([Mold2()])
self.assertEqual(self.dataset.X.shape, (len(self.dataset), 777))
self.assertTrue(self.dataset.X.any().any())
self.assertTrue(self.dataset.X.any().sum() > 1)
# @skipIf(platform.system() == "Darwin", "Mold2 not supported on Mac OS")
# def testMold2(self):
# """Test the Mold2 descriptor calculator."""
# self.dataset.nJobs = 1
# self.dataset.addDescriptors([Mold2()])
# self.assertEqual(self.dataset.X.shape, (len(self.dataset), 777))
# self.assertTrue(self.dataset.X.any().any())
# self.assertTrue(self.dataset.X.any().sum() > 1)

def testPaDELDescriptors(self):
"""Test the PaDEL descriptor calculator."""
Expand Down
16 changes: 8 additions & 8 deletions qsprpred/extra/data/utils/testing/path_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ def getAllDescriptors(cls) -> list[DescriptorSet]:
PaDEL(),
ExtendedValenceSignature(1),
]
if platform.system() != "Darwin":
ret.append(Mold2())
else:
# not supported on macOS
logger.warning(
"Mold2 is not supported on macOS. "
"Skipping Mold2 descriptor set in tests."
)
# if platform.system() != "Darwin":
# ret.append(Mold2())
# else:
# # not supported on macOS
# logger.warning(
# "Mold2 is not supported on macOS. "
# "Skipping Mold2 descriptor set in tests."
# )
return ret

@classmethod
Expand Down

0 comments on commit 2e1f75f

Please sign in to comment.