Skip to content

Commit

Permalink
Issue 239 hss bug for 1 1 (#241)
Browse files Browse the repository at this point in the history
* fixed calculations of calculate_hss in v1.1 #239

* added v1.1.2
  • Loading branch information
TatianaBurek authored Nov 21, 2022
1 parent 983c72b commit 4defd00
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions docs/Users_Guide/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ describes the bugfix, enhancement, or new feature: `METcalcpy GitHub issues. <ht
Version |version| release notes (|release_date|)
------------------------------------------------

Version 1.1.2 release notes (20221118)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Bug Fix:

* Fixed Heidke Skill Score Calculation Discrepancy (`#239 <https://github.com/dtcenter/METcalcpy/issues/239>`_)

Version 1.1.1 release notes (20220727)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Bug Fix:
Expand Down
2 changes: 1 addition & 1 deletion docs/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__="1.1.1"
__version__="1.1.2"
9 changes: 5 additions & 4 deletions metcalcpy/util/ctc_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,11 @@ def calculate_hss(input_data, columns_names):
if total == 0:
return None
fy_oy = sum_column_data_by_name(input_data, columns_names, 'fy_oy')
dbl_c = ((fy_oy + sum_column_data_by_name(input_data, columns_names, 'fy_on')) / total) \
* (fy_oy + sum_column_data_by_name(input_data, columns_names, 'fn_oy'))
hss = ((fy_oy + sum_column_data_by_name(input_data, columns_names, 'fn_on') - dbl_c)
/ (total - dbl_c))
fy_on = sum_column_data_by_name(input_data, columns_names, 'fy_on')
fn_oy = sum_column_data_by_name(input_data, columns_names, 'fn_oy')
fn_on = sum_column_data_by_name(input_data, columns_names, 'fn_on')
dbl_c = ((fy_oy + fy_on) / total) * (fy_oy + fn_oy) + ((fn_oy + fn_on) / total) * (fy_on + fn_on)
hss = ((fy_oy + fn_on - dbl_c) / (total - dbl_c))
hss = round_half_up(hss, PRECISION)
except (TypeError, ZeroDivisionError, Warning, ValueError):
hss = None
Expand Down

0 comments on commit 4defd00

Please sign in to comment.