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

Add check before plotting wind barbs #2788

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sgdecker
Copy link
Contributor

@sgdecker sgdecker commented Nov 10, 2022

Description Of Changes

Currently, BarbPlot is happy to attempt to plot very large wind barbs, but if the size becomes too large, memory usage becomes an issue, leading to system hangs. This commit adds a check to make sure the wind barbs will not consist of so many pennants that memory could be an issue.

Checklist

@sgdecker
Copy link
Contributor Author

This is the kind of check I am envisioning.

Fixes Unidata#2785.

Currently, BarbPlot is happy to attempt to plot very large wind barbs,
but if the size becomes too large, memory usage becomes an issue,
leading to system hangs.  This commit adds a check to make sure the
wind barbs will not consist of so many pennants that memory could be
an issue.
@sgdecker sgdecker marked this pull request as ready for review November 17, 2022 21:34
@sgdecker sgdecker requested review from a team and kgoebber as code owners November 17, 2022 21:34
@sgdecker sgdecker requested review from dcamron and removed request for a team November 17, 2022 21:34
@needs_cartopy
def test_too_big_error_barbs():
"""Make sure we get an error when we are about to draw too many pennants."""
data = xr.open_dataset(get_test_data('narr_example.nc', as_file_obj=False)).squeeze()

Check warning

Code scanning / CodeQL

File is not always closed

File is opened but is not closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Raise error instead of attempting absurd BarbPlot
1 participant