You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Shear.BySector] IndexError when direction_bin_labels is given #636
Describe the bug Shear.BySector fails with an IndexError when custom direction_bin_labels are passed. plot_shear_by_sector() reads the sector bin edges from the index labels of the wind rose data using a regex (plot.py, ~line 1977), so any label that isn't of the form '0.0-90.0' breaks it.
IndexError: list index out of range in plot_shear_by_sector.
Expected behaviour
The labels are used for display only. The bin edges should come from direction_bin_array (or the default sector bins), not be parsed from the labels.
Hi! I noticed this issue and have submitted PR #643 with a fix. The problem is that plot_shear_by_sector() uses a regex to extract bin edges from index labels, which fails when custom text labels (like 'northerly', 'easterly') are used. My fix adds a fallback to use direction_bin_array when the regex returns fewer than 2 numbers. Please let me know if you would like any adjustments!
Activity
Jah-yee commentedon Oct 3, 2026
Hi! I noticed this issue and have submitted PR #643 with a fix. The problem is that plot_shear_by_sector() uses a regex to extract bin edges from index labels, which fails when custom text labels (like 'northerly', 'easterly') are used. My fix adds a fallback to use direction_bin_array when the regex returns fewer than 2 numbers. Please let me know if you would like any adjustments!