Skip to content

Commit

Permalink
Issues/224/add classes to init (#225)
Browse files Browse the repository at this point in the history
* Adde metric classes to __init__ and make a ValueError more informative

* Adde metric classes to __init__ and make a ValueError more informative
  • Loading branch information
eacharles authored May 16, 2024
1 parent 29c1491 commit f0bf3ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/qp/metrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from .metrics import *
from .goodness_of_fit import *
from .base_metric_classes import *
from .concrete_metric_classes import *
from .point_estimate_metric_classes import *

# added for testing purposes

Expand Down
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 f0bf3ce

Please sign in to comment.