Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyiem.plot.pretty_bins IndexError #665

Closed
akrherz opened this issue Oct 21, 2022 · 0 comments · Fixed by #666
Closed

pyiem.plot.pretty_bins IndexError #665

akrherz opened this issue Oct 21, 2022 · 0 comments · Fixed by #666
Assignees
Labels

Comments

@akrherz
Copy link
Owner

akrherz commented Oct 21, 2022

This is suboptimal

>>> from pyiem.plot import pretty_bins
>>> pretty_bins(21.5, 9886.5)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/akrherz/projects/pyIEM/src/pyiem/plot/util.py", line 105, in pretty_bins
    return centered_bins(maxval - center, on=center, bins=bins)
  File "/home/akrherz/projects/pyIEM/src/pyiem/plot/util.py", line 127, in centered_bins
    step = avail[np.digitize(step, avail)]
IndexError: list index out of range
@akrherz akrherz added the bug label Oct 21, 2022
@akrherz akrherz self-assigned this Oct 21, 2022
akrherz added a commit that referenced this issue Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant