Deltares-research / kenmerkendewaarden

Derive indicators from waterlevel measurements
https://deltares-research.github.io/kenmerkendewaarden/
GNU General Public License v3.0
1 stars 0 forks source link

compare station attribute in `plot_overschrijding()` #95

Closed veenstrajelmer closed 3 weeks ago

veenstrajelmer commented 1 month ago

When adding a station comparison to kw.plot_overschrijding(), we get KeyError: 'station':

# get and compare station attributes
station_attrs = [v.attrs["station"] for k,v in dist.items()]
assert all(x == station_attrs[0] for x in station_attrs)
station = station_attrs[0]

This happens because weibul looses attributes and Hydra does not have attributes also. The code [print(k, v.attrs) for k,v in dist_exc.items()] prints:

Hydra-NL {}
Hydra-NL met modelonzekerheid {}
validation {}
Ongefilterd {'station': 'HOEKVHLD'}
Trendanalyse {'station': 'HOEKVHLD'}
Weibull {}
Gecombineerd {}
Geinterpoleerd {}