Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 404 v3.0.0 beta6 #407

Merged
merged 7 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions docs/Users_Guide/release-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,27 @@ describes the bugfix, enhancement, or new feature: `METcalcpy GitHub issues. <ht
METcalcpy Release Notes
=======================

METcalcpy Velsion 3.0.0-beta6 release notes (20241017)
------------------------------------------------------

.. dropdown:: New Functionality

None

.. dropdown:: Enhancements

* Improve logging for 5 STIGs (`METplus-Internal#46 <https://github.com/dtcenter/METplus-Internal/issues/46>`_)

.. dropdown:: Internal

None

.. dropdown:: Bugfixes

* Bugfix: MODE CSI calculations result in spurious results (`#360 <https://github.com/dtcenter/METcalcpy/issues/360>`_)


METcalcpy Velsion 3.0.0-beta5 release notes (20230628)
METcalcpy Velsion 3.0.0-beta5 release notes (20240628)
------------------------------------------------------


Expand All @@ -31,7 +50,7 @@ METcalcpy Velsion 3.0.0-beta5 release notes (20230628)
.. dropdown:: Bugfixes


METcalcpy Velsion 3.0.0-beta4 release notes (20230417)
METcalcpy Velsion 3.0.0-beta4 release notes (20240417)
------------------------------------------------------


Expand All @@ -57,7 +76,7 @@ METcalcpy Velsion 3.0.0-beta4 release notes (20230417)

* Address negative values returned by calculate_bcmse() and calculate_bcrmse() in sl1l2_statistics module (`#329 <https://github.com/dtcenter/METcalcpy/issues/329>`_)

METcalcpy Velsion 3.0.0-beta3 release notes (20230207)
METcalcpy Velsion 3.0.0-beta3 release notes (20240207)
------------------------------------------------------


Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
verinfo = version
release = f'{version}'
release_year = '2024'
release_date = f'{release_year}-06-28'
release_date = f'{release_year}-10-17'
copyright = f'{release_year}, {author}'

# if set, adds "Last updated on " followed by
Expand Down
2 changes: 1 addition & 1 deletion docs/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__="3.0.0-beta6-dev"
__version__="3.0.0-beta6"
16 changes: 7 additions & 9 deletions metcalcpy/sum_stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def process_rows(self):
# return self.parallelize(data, partial(self.run_on_subset, func), num_of_processes)


def calculate_statistic(self, values, columns_names, stat_name, aggregation=False):
def calculate_statistic(values, columns_names, stat_name, aggregation=False):
"""Calculate the statistic of values
Args:
values: a np.array of values we want to calculate the statistic on
Expand All @@ -307,19 +307,17 @@ def calculate_statistic(self, values, columns_names, stat_name, aggregation=Fals
Raises:
an error
"""
logger = self.logger
safe_log(logger, "debug", f"Calculating statistic '{stat_name}' with aggregation: {aggregation}.")
try:
func_name = f'calculate_{stat_name}'
num_parameters = len(signature(globals()[func_name]).parameters)
if num_parameters == 2:
stat = globals()[func_name](values, columns_names, logger=logger)
stat = globals()[func_name](values, columns_names)
else:
stat = globals()[func_name](values, columns_names, aggregation, logger=logger)
safe_log(logger, "info", f"Successfully calculated statistic '{stat_name}'.")
except Exception as e:
safe_log(logger, "error", f"An error occurred while calculating statistic '{stat_name}': {e}")
raise
stat = globals()[func_name](values, columns_names, aggregation)
except Exception:
raise RuntimeError(
"Error occurred while calculating statistic using METcalcpy sum_stat module's calculate_statistic(): " +
stat_name)
return stat


Expand Down
2 changes: 1 addition & 1 deletion metcalcpy/util/ctc_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def calculate_pofd(input_data, columns_names, logger=None):
result = fy_on / oy
result = round_half_up(result, PRECISION)
safe_log(logger, "info", f"POFD calculation successful: {result}")
except (TypeError, ZeroDivisionError, Warning, ValueError):
except (TypeError, ZeroDivisionError, Warning, ValueError) as e:
safe_log(logger, "error", f"Error in POFD calculation: {e}")
result = None
warnings.filterwarnings('ignore')
Expand Down
Loading