Skip to content

Commit

Permalink
cleaned comments and alignments
Browse files Browse the repository at this point in the history
  • Loading branch information
veenstrajelmer committed Jun 20, 2024
1 parent d13957a commit 8dfd92f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions examples/KWK_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
ax1.plot(yearmeanHW['values'],'+g', zorder=0)
ax1.plot(yearmeanLW['values'],'+g', zorder=0)
ax1.plot(yearmeanwl['values'],'+g',label='yearmean validation', zorder=0)
ax1.legend(loc=2)
ax1.legend(loc=2)

fig1.savefig(os.path.join(dir_slotgem,f'yearly_values_{current_station}'))

Expand Down Expand Up @@ -227,12 +227,12 @@


###OVERSCHRIJDINGSFREQUENTIES
#TODO: SLR trend correctie voor overschrijdingsfrequenties en evt ook voor andere KW?
#TODO: resulting freqs seem to be shifted w.r.t. getijtafelboekje (mail PH 9-3-2022)
#plots beoordelen: rode lijn moet ongeveer verlengde zijn van groene, als die ineens omhoog piekt komt dat door hele extreme waardes die je dan vermoedelijk ook al ziet in je groene lijn
# TODO: SLR trend correctie voor overschrijdingsfrequenties en evt ook voor andere KW?
# TODO: resulting freqs seem to be shifted w.r.t. getijtafelboekje (mail PH 9-3-2022)
# plots beoordelen: rode lijn moet ongeveer verlengde zijn van groene, als die ineens omhoog piekt komt dat door hele extreme waardes die je dan vermoedelijk ook al ziet in je groene lijn

Tfreqs_interested = [5, 2, 1, 1/2, 1/5, 1/10, 1/20, 1/50, 1/100, 1/200, #overschrijdingsfreqs
1/500, 1/1000, 1/2000, 1/4000, 1/5000, 1/10000] #TODO: which frequencies are realistic with n years of data? probably remove this entire row >> met 40 jaar data kun je in principe tot 1/40 gaan, maar met weibull kun je extrapoleren en in theorie >> dit is voor tabel die je eruit wil hebben
Tfreqs_interested = [5, 2, 1, 1/2, 1/5, 1/10, 1/20, 1/50, 1/100, 1/200,
1/500, 1/1000, 1/2000, 1/4000, 1/5000, 1/10000]

if compute_overschrijding and data_pd_HWLW_all is not None:
print(f'overschrijdingsfrequenties for {current_station}')
Expand Down
2 changes: 1 addition & 1 deletion kenmerkendewaarden/data_retrieve.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def xarray_to_hatyan(ds):
if "HWLWcode" in ds.data_vars:
df["HWLWcode"] = ds["HWLWcode"]

# convert timezone back to UTC+1 # TODO: add testcase
# convert timezone back to UTC+1
df.index = df.index.tz_localize("UTC").tz_convert("Etc/GMT-1")

# add attrs
Expand Down
4 changes: 2 additions & 2 deletions kenmerkendewaarden/tidalindicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def calc_HWLWtidalindicators(df_ext, min_coverage:float = None):
----------
data_pd_HWLW_all : TYPE
DESCRIPTION.
min_coverage : float, optional
The minimum percentage (from 0 to 1) of timeseries coverage to consider the statistics to be valid. The default is None.
min_coverage : float, optional
The minimum percentage (from 0 to 1) of timeseries coverage to consider the statistics to be valid. The default is None.
Returns
-------
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tidalindicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def test_calc_HWLWtidalindicators(df_meas_2010_2014):

@pytest.mark.unittest
def test_calc_wltidalindicators_mincount(df_meas_2010_2014):
# create dataset with a gap
df_meas_withgap = df_meas_2010_2014.copy() # copy to prevent altering the original dataset
df_meas_withgap.loc["2012-01-01":"2012-01-15", "values"] = np.nan
df_meas_withgap.loc["2012-01-01":"2012-01-15", "qualitycode"] = 99

# create dataset with a gap
slotgemiddelden_dict_nogap = kw.calc_wltidalindicators(df_meas_2010_2014, min_coverage=1)
slotgemiddelden_dict_withgap = kw.calc_wltidalindicators(df_meas_withgap, min_coverage=1)
slotgemiddelden_dict_withgap_lower_threshold = kw.calc_wltidalindicators(df_meas_withgap, min_coverage=0.95)
Expand Down

0 comments on commit 8dfd92f

Please sign in to comment.