Skip to content

Commit

Permalink
Issue #329 return 0 if negative BCMSE value is calculated
Browse files Browse the repository at this point in the history
  • Loading branch information
bikegeek committed Dec 21, 2023
1 parent 444b336 commit adf7b07
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions metcalcpy/util/sl1l2_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,13 @@ def calculate_bcmse(input_data, columns_names, aggregation=False):
"""
warnings.filterwarnings('error')
try:

mse = calculate_mse(input_data, columns_names, aggregation)
me = calculate_me(input_data, columns_names, aggregation)
result = mse - me ** 2
result = round_half_up(result, PRECISION)
if result < 0:
return 0.
except (TypeError, Warning):
result = None
warnings.filterwarnings('ignore')
Expand Down

0 comments on commit adf7b07

Please sign in to comment.