def _check_score(self, score): if score < 0.0: raise errors.InvalidScoreError( ( "RelativeDifferenceScore was initialized with " "a score of %f, but a RelativeDifferenceScore " "must be non-negative." ) % score )
def _check_score(self, score): if not (-1.0 <= score <= 1.0): raise errors.InvalidScoreError(("Score of %.3g must be in " "range [-1.0, 1.0]" % score))
def _check_score(self, score): if isinstance(score, pq.Quantity) and score.size != 1: raise errors.InvalidScoreError("Score must have size 1.")
def _check_score(self, score): if not (0.0 <= score <= 100.0): raise errors.InvalidScoreError(("Score of %f must be in " "range 0.0-100.0" % score))