Skip to content

Commit

Permalink
Fixed log_norm_score handling of None
Browse files Browse the repository at this point in the history
  • Loading branch information
rgerkin committed Feb 12, 2020
1 parent 9a9eb82 commit 1369713
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sciunit/scores/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,19 @@ def norm_score(self):
def log_norm_score(self):
"""The natural logarithm of the `norm_score`.
This is useful for guaranteeing convexity in an error surface"""
return np.log(self.norm_score)
return np.log(s.norm_score) if s.norm_score is not None else None

@property
def log2_norm_score(self):
"""The logarithm base 2 of the `norm_score`.
This is useful for guaranteeing convexity in an error surface"""
return np.log2(self.score)
return np.log2(s.norm_score) if s.norm_score is not None else None

@property
def log10_norm_score(self):
"""The logarithm base 10 of the `norm_score`.
This is useful for guaranteeing convexity in an error surface"""
return np.log10(self.score)
return np.log10(s.norm_score) if s.norm_score is not None else None

def color(self, value=None):
"""Turn the score intp an RGB color tuple of three 8-bit integers."""
Expand Down

0 comments on commit 1369713

Please sign in to comment.