예제 #1
0
파일: complete.py 프로젝트: AditiRM/sciunit
 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
         )
예제 #2
0
 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))
예제 #3
0
 def _check_score(self, score):
     if isinstance(score, pq.Quantity) and score.size != 1:
         raise errors.InvalidScoreError("Score must have size 1.")
예제 #4
0
 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))