From a2402586b12f7a2074be9bb812a721ff617932e6 Mon Sep 17 00:00:00 2001 From: KonstantinChri Date: Thu, 24 Apr 2025 22:32:15 +0200 Subject: [PATCH] update --- examples/example_NORA_wind_waves.py | 2 +- metocean_stats/stats/extreme.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/example_NORA_wind_waves.py b/examples/example_NORA_wind_waves.py index 7718869..75032bc 100644 --- a/examples/example_NORA_wind_waves.py +++ b/examples/example_NORA_wind_waves.py @@ -33,7 +33,7 @@ plots.var_rose(df,var_dir=var_wind_dir,var=var_wind,method='overall',max_perc=40,decimal_places=1, units='m/s',output_file=folder / 'wind_omni.png') plots.var_rose(df,var_dir=var_wind_dir,var=var_wind,method='monthly',max_perc=40,decimal_places=1, units='m/s',output_file=folder / 'wind_monthly.png') plots.plot_directional_stats(df,var=var_wind,step_var=0.1,var_dir=var_wind_dir,title = 'W10[m/s]', output_file=folder / 'directional_wind_stats.png') -plots.table_directional_non_exceedance(df,var=var_wind,step_var=2,var_dir=var_wind_dir,output_file=folder / 'table_wind_directional_non_exceedance.csv') +tables.table_directional_non_exceedance(df,var=var_wind,step_var=2,var_dir=var_wind_dir,output_file=folder / 'table_wind_directional_non_exceedance.csv') plots.plot_monthly_stats(df,var=var_wind,title = 'Wind Speed at 10 m [m/s]', output_file=folder / 'monthly_wind_stats.png') tables.table_monthly_non_exceedance(df,var=var_wind,step_var=2,output_file=folder / 'table_monthly_non_exceedance.csv') plots.plot_prob_non_exceedance_fitted_3p_weibull(df,var=var_wind,output_file=folder / 'prob_non_exceedance_fitted_3p_weibull_wind.png') diff --git a/metocean_stats/stats/extreme.py b/metocean_stats/stats/extreme.py index 22cab2d..d8275eb 100644 --- a/metocean_stats/stats/extreme.py +++ b/metocean_stats/stats/extreme.py @@ -813,7 +813,7 @@ def directional_extremes(data: pd.DataFrame, var: str, var_dir: str, periods=[1, for dir in range(0,360,30): sector_data = data[data['direction_sector']==dir] if sector_data.empty: - sector_data = data * 0 # fill with zeros, this will give 0 extremes for empety sectors + sector_data = data.loc[:, data.select_dtypes(include=['number']).columns] * 0 # fill with zeros, this will give 0 extremes for empty sectors if isinstance(threshold, str) and threshold.startswith('P'): threshold_value = sector_data[var].quantile(int(threshold.split('P')[1])/100)