From e094160dcda2e75874b9552c8a6eca0e60019995 Mon Sep 17 00:00:00 2001 From: Arthur O'Dwyer Date: Sat, 15 Apr 2017 23:07:28 -0700 Subject: [PATCH] More Pythonic cleanups. NFC. --- copycat/codeletMethods.py | 2 +- copycat/group.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/copycat/codeletMethods.py b/copycat/codeletMethods.py index b36ecc2..11df779 100644 --- a/copycat/codeletMethods.py +++ b/copycat/codeletMethods.py @@ -73,7 +73,7 @@ def __getDescriptors(bondFacet, source, destination): def __allOppositeMappings(mappings): - return len([m for m in mappings if m.label != slipnet.opposite]) == 0 + return all(m.label == slipnet.opposite for m in mappings) def __structureVsStructure(structure1, weight1, structure2, weight2): diff --git a/copycat/group.py b/copycat/group.py index fef8cd3..4ae181e 100644 --- a/copycat/group.py +++ b/copycat/group.py @@ -197,7 +197,7 @@ class Group(WorkspaceObject): def localSupport(self): numberOfSupporters = self.numberOfLocalSupportingGroups() - if numberOfSupporters == 0.0: + if numberOfSupporters == 0: return 0.0 supportFactor = min(1.0, 0.6 ** (1 / (numberOfSupporters ** 3))) densityFactor = 100.0 * ((self.localDensity() / 100.0) ** 0.5)