Skip to content

Commit

Permalink
Adde metric classes to __init__ and make a ValueError more informative
Browse files Browse the repository at this point in the history
  • Loading branch information
eacharles committed May 16, 2024
1 parent 7f74a75 commit bffd5d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/qp/metrics/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def _prepare_for_brier(p, truth, limits, dx=0.01):
# Values of truth that are outside the defined limits will not appear truth_array.
# Consider expanding the limits or using numpy.clip to restrict truth values to the limits.
if np.any(np.less(truth, limits[0])) or np.any(np.greater(truth, limits[1])):
raise ValueError("Input truth values exceed the defined limits")
raise ValueError(f"Input truth values exceed the defined limits ({min(truth)}, {max(truth)}) ({limits[0]} {limits[1]})")

# Make a grid object that defines grid values and histogram bin edges using limits and dx
grid = _calculate_grid_parameters(limits, dx)
Expand Down

0 comments on commit bffd5d6

Please sign in to comment.