From 4defd00d521c823c3e4b2a8fef4a0e0a35f325c5 Mon Sep 17 00:00:00 2001 From: Tatiana Burek Date: Mon, 21 Nov 2022 08:02:42 -0700 Subject: [PATCH] Issue 239 hss bug for 1 1 (#241) * fixed calculations of calculate_hss in v1.1 #239 * added v1.1.2 --- docs/Users_Guide/release-notes.rst | 6 ++++++ docs/version | 2 +- metcalcpy/util/ctc_statistics.py | 9 +++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/Users_Guide/release-notes.rst b/docs/Users_Guide/release-notes.rst index f664b233..e463f616 100644 --- a/docs/Users_Guide/release-notes.rst +++ b/docs/Users_Guide/release-notes.rst @@ -7,6 +7,12 @@ describes the bugfix, enhancement, or new feature: `METcalcpy GitHub issues. `_) + Version 1.1.1 release notes (20220727) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Bug Fix: diff --git a/docs/version b/docs/version index 6d8a2612..7e8e306e 100644 --- a/docs/version +++ b/docs/version @@ -1 +1 @@ -__version__="1.1.1" +__version__="1.1.2" diff --git a/metcalcpy/util/ctc_statistics.py b/metcalcpy/util/ctc_statistics.py index ce0ca819..9f1ddf5f 100644 --- a/metcalcpy/util/ctc_statistics.py +++ b/metcalcpy/util/ctc_statistics.py @@ -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