Skip to content

Commit

Permalink
Changed error handling in compute_score
Browse files Browse the repository at this point in the history
  • Loading branch information
rgerkin committed Mar 9, 2018
1 parent bf920b5 commit 1b8c243
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sciunit/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ def compute_score(self, observation, prediction):
No default implementation.
"""

try:
# After some processing of the observation and the prediction.
score = self.score_type.compute(observation,prediction)
return score
except:
raise NotImplementedError(("Test %s either implements no "
if not hasattr(self,'score_type') or \
not hasattr(self.score_type,'compute'):
raise NotImplementedError(("Test %s either implements no "
"compute_score method or provides no "
"score_type with a compute method.") \
% self.name)
# After some processing of the observation and the prediction.
score = self.score_type.compute(observation,prediction)
return score

def _bind_score(self,score,model,observation,prediction):
"""
Expand Down

0 comments on commit 1b8c243

Please sign in to comment.