From 46eb68ac1ce4050b0fbeb75021d72c6da7630194 Mon Sep 17 00:00:00 2001 From: Konstantinos Christakos <67804784+KonstantinChri@users.noreply.github.com> Date: Tue, 17 Dec 2024 13:28:01 +0100 Subject: [PATCH 1/2] Update extreme.py --- metocean_stats/tables/extreme.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metocean_stats/tables/extreme.py b/metocean_stats/tables/extreme.py index 04f6cac..96985da 100644 --- a/metocean_stats/tables/extreme.py +++ b/metocean_stats/tables/extreme.py @@ -65,7 +65,7 @@ def table_monthly_return_periods(data, var='hs', periods=[1, 10, 100, 10000],dis shape = ['-'] + [round(shape, 3) if isinstance(shape, (int, float)) else shape for shape, _, _ in params] scale = [units] + [round(scale, 3) if isinstance(scale, (int, float)) else scale for _, _, scale in params] location = [units] + [round(loc, 2) if isinstance(loc, (int, float)) else loc for _, loc, _ in params] - shape = ['-' if element == [] else element for element in shape] + shape = ['-' if (isinstance(element, (list, np.ndarray)) and len(element) == 0) else element for element in shape] table_data = { 'Month': months, From f659fe5a72c4bf0d2854768b24fa84492c165ca9 Mon Sep 17 00:00:00 2001 From: Konstantinos Christakos <67804784+KonstantinChri@users.noreply.github.com> Date: Tue, 17 Dec 2024 13:29:33 +0100 Subject: [PATCH 2/2] Update extreme.py --- metocean_stats/tables/extreme.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metocean_stats/tables/extreme.py b/metocean_stats/tables/extreme.py index 96985da..730dffe 100644 --- a/metocean_stats/tables/extreme.py +++ b/metocean_stats/tables/extreme.py @@ -98,7 +98,7 @@ def table_directional_return_periods(data: pd.DataFrame, var='hs', var_dir='dir' shape = ['-'] + [round(shape, 3) if isinstance(shape, (int, float)) else shape for shape, _, _ in params] scale = [units] + [round(scale, 3) if isinstance(scale, (int, float)) else scale for _, _, scale in params] location = [units] + [round(loc, 2) if isinstance(loc, (int, float)) else loc for _, loc, _ in params] - shape = ['-' if element == [] else element for element in shape] + shape = ['-' if (isinstance(element, (list, np.ndarray)) and len(element) == 0) else element for element in shape] # Create the table data dictionary table_data = {