Skip to content
Snippets Groups Projects
Commit 0665a173 authored by Studer Gabriel's avatar Studer Gabriel
Browse files

Return None in case of no contacts in QS-score

The score is simply not valid and returning 0.0 as done before is incorrect.
Delegates further treatment of the problem to the caller which might want to
say: if both structures are monomer, I still give it a value of 1. Or, to
extend that definition, if I reproduced the correct stoichiometry, I still
give it a value of 1.
parent c65554c5
No related branches found
No related tags found
No related merge requests found
......@@ -255,6 +255,8 @@ class QSScorerResult:
def QS_best(self):
""" QS_best - the actual score as described in formula section above
Returns None if there are no contacts in the compared structures
:type: :class:`float`
"""
nominator = self.weighted_scores
......@@ -262,12 +264,14 @@ class QSScorerResult:
if denominator != 0.0:
return nominator/denominator
else:
return 0.0
return None
@property
def QS_global(self):
""" QS_global - the actual score as described in formula section above
Returns None if there are no contacts in the compared structures
:type: :class:`float`
"""
nominator = self.weighted_scores
......@@ -275,7 +279,7 @@ class QSScorerResult:
if denominator != 0.0:
return nominator/denominator
else:
return 0.0
return None
class QSScorer:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment