Skip to content

Commit

Permalink
fix for empty stresses df
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrakenhoff committed Oct 10, 2024
1 parent 1cf6332 commit a95cc1d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pastastore/extensions/hpd.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,17 @@ def update_knmi_meteo(
**kwargs : dict, optional
Additional keyword arguments to pass to `hpd.read_knmi()`
"""
if "source" not in self._store.stresses.columns:
msg = (
"Cannot update KNMI stresses! "
"KNMI stresses cannot be identified if 'source' column is not defined."
)
logger.error(msg)
if raise_on_error:
raise ValueError(msg)
else:
return

if names is None:
names = self._store.stresses.loc[
self._store.stresses["source"] == "KNMI"
Expand Down

0 comments on commit a95cc1d

Please sign in to comment.