Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review rdkit.Chem.pharm#D modules #1201

Merged
merged 25 commits into from Jan 15, 2017
Merged

Conversation

gedeck
Copy link
Collaborator

@gedeck gedeck commented Dec 13, 2016

  • General cleanup of code
  • Extended some of the unittests
  • Moved running of doctest into unittest

Copy link
Member

@greglandrum greglandrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not huge changes, but some that ought to be done.

@@ -92,7 +95,7 @@ def GetBitDescriptionAsText(self, bitIdx, includeBins=0, fullPage=1):
a string with the HTML

"""
nPts, combo, scaffold, labels, dMat = self._GetBitSummaryData(bitIdx)
raise NotImplementedError('Missing implementation')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice one. This must have been a leftover from a (much) older version of the code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So remove it then?

@@ -0,0 +1,30 @@
# $Id$
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please no new SVN droppings.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed all SVN tags from the Pharm2D and Pharm3D folders

@@ -0,0 +1,30 @@
# $Id$
#
# Copyright (C) 2002-2006 greg Landrum and Rational Discovery LLC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

year could be updated, but it's not critical

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a more general question on how to handle the legal blurb. I understand the situation is more complex due to the history of the code, however what about having a generic statement in each file referring to the license.txt ((C) Rational Discovery LLC, Greg Landrum, and Julie Penzotti) file for all original files (btw. year there is 2006-2015). But then, what to do about modifications?

@@ -129,8 +131,8 @@ def testOrderBug(self):
m2 = next(suppl)
sig1 = Generate.Gen2DFingerprint(m1, self.factory)
sig2 = Generate.Gen2DFingerprint(m2, self.factory)
ob1 = set(sig1.GetOnBits())
ob2 = set(sig2.GetOnBits())
# ob1 = set(sig1.GetOnBits())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well just delete these.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

def test1(self):
""" simple tests
def test_NotImplemented(self):
assert LazyGenerator is None, 'Review LazyGenerator unit tests'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should really be using the UnitTest methods (though the rest of the file doesn't currently do so)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LazyGenerator code is not working. This assert is there in case someone starts to fix it. Changed it.

class TestCase(unittest.TestCase):

def setUp(self):
self.dataDir = os.path.join(RDConfig.RDCodeDir, 'Chem/Pharm3D/test_data')
self.fdefBlock = \
"""DefineFeature HAcceptor1 [N,O;H0]
self.fdefBlock = """
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parser probably doesn't care, but this is a different string, so it's not just a simple re-fomatting

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. I give it a positive spin though. We also test that the parser is capable of handling extra lines ;-)

@@ -0,0 +1,37 @@
# $Id$
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please no new subversion droppings in code

@@ -0,0 +1,37 @@
# $Id$
#
# Copyright (C) 2004-2008 greg Landrum and Rational Discovery LLC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usual thing about the name and date on new copyrights

@@ -28,8 +25,8 @@ def feq(n1, n2, tol=1e-5):
class TestCase(unittest.TestCase):

def setUp(self):
self.fdefBlock = \
"""DefineFeature HAcceptor1 [N,O;H0]
self.fdefBlock = """
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above: This is now a different string than before, so there should be an actual reason for this change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reason: aversion against \

@@ -1,6 +1,7 @@
tests = [
("python", "EmbedLib.py", {}),
# ("python", "EmbedLib.py", {}),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that file still contains doctests (and should still contain doctests), they should be run. Please turn this back on.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UnitTestEmbed runs the doctest, so I remove this line.

@greglandrum greglandrum merged commit 7df0663 into rdkit:master Jan 15, 2017
@greglandrum greglandrum added this to the 2017_03_1 milestone Jan 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants