Skip to content

Commit

Permalink
Merge pull request #102 from rubisco-sfa/mcguire
Browse files Browse the repository at this point in the history
FIX: Sneaky bugs reported by Patrick McGuire
  • Loading branch information
nocollier authored Aug 28, 2024
2 parents f3e38c1 + 26774d9 commit 0a26232
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ILAMB/Confrontation.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ def determinePlotLimits(self):

# Determine plot limits and colormap
if opts["sym"]:
vabs = max(abs(limits[pname]["min"]), abs(limits[pname]["min"]))
vabs = max(abs(limits[pname]["min"]), abs(limits[pname]["max"]))
limits[pname]["min"] = -vabs
limits[pname]["max"] = vabs
if "shift" in pname:
Expand Down Expand Up @@ -705,6 +705,8 @@ def _computeOverallScore(scalars):
weight = self.weight[score]
overall_score += weight * scalars.variables[v][...]
sum_of_weights += weight
if np.abs(overall_score) < 1e-12:
overall_score = np.nan
overall_score /= max(sum_of_weights, 1e-12)
scores["Overall Score %s" % region] = overall_score
return scores
Expand Down

0 comments on commit 0a26232

Please sign in to comment.