Skip to content

plot_frequencies_time_series() does not handle missing CI variables when ci_method=None #1035

@adilraza99

Description

@adilraza99

Summary

plot_frequencies_time_series() assumes that CI-related variables (event_frequency_ci_low, event_frequency_ci_upp) are present in the
input dataset and accesses them without validation.

Problem

In the advanced frequency functions, confidence interval variables are only added when ci_method is not None. Since ci_method=None is a valid and supported parameter value, datasets can legitimately be created without CI fields.

When such a dataset is passed to plot_frequencies_time_series(), the function raises a KeyError due to unconditional access of
missing variables.

Impact

This results in an unexpected runtime failure for a valid input configuration, reducing robustness in the plotting layer.

Suggested Direction

The plotting function could either:

  • Gracefully handle datasets without CI variables (e.g., omit error bars), or
  • Explicitly validate their presence and raise a clearer error message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions