Hi,
I noticed a small issue in create_flood_events() in gauges.py.
For some gauges (e.g., CORM8), certain flood categories are missing. For example, for this gauge the "action" stage is not defined on the NOAA page. However, the API returns a placeholder value like -9999 for missing stages. Since the current logic only checks for None, these values are still plotted:
stage = details.get("stage", None)
if stage is not None:
This adds invalid threshold lines (e.g., at -9999), stretching the y-axis and distorting the plot.
Suggested fix
Filter out placeholder values:
raw_stage = details.get("stage", None)
if raw_stage in [None, "", -9999, -9999.0, "-9999", "-9999.0"]:
continue
This ensures that only valid flood stages are plotted when available.
Screenshots
Before fix:

After fix:

Happy to open a PR if needed.
Thanks!
Hi,
I noticed a small issue in
create_flood_events()ingauges.py.For some gauges (e.g.,
CORM8), certain flood categories are missing. For example, for this gauge the "action" stage is not defined on the NOAA page. However, the API returns a placeholder value like-9999for missing stages. Since the current logic only checks forNone, these values are still plotted:This adds invalid threshold lines (e.g., at
-9999), stretching the y-axis and distorting the plot.Suggested fix
Filter out placeholder values:
This ensures that only valid flood stages are plotted when available.
Screenshots
Before fix:

After fix:

Happy to open a PR if needed.
Thanks!