Skip to content

Conversation

@kgoebber
Copy link
Collaborator

@kgoebber kgoebber commented Sep 3, 2022

Description Of Changes

This PR adds a new feature to plot arrows (quivers) to the declarative syntax. Kept the implementation basic in terms of options to change and hardest part was coming up with a reasonable way to add a quiverkey. Open to suggestions for improvement on any part, but especially the key portion.

Checklist

@kgoebber kgoebber requested a review from a team as a code owner September 3, 2022 22:04
@kgoebber kgoebber requested review from dopplershift and removed request for a team September 3, 2022 22:04
@needs_cartopy
def test_declarative_arrowplot():
"""Test making a arrow plot."""
data = xr.open_dataset(get_test_data('narr_example.nc', as_file_obj=False))

Check warning

Code scanning / CodeQL

File is not always closed

File is opened but is not closed.
@needs_cartopy
def test_declarative_arrowkey():
"""Test making a arrow plot with an arrow key."""
data = xr.open_dataset(get_test_data('narr_example.nc', as_file_obj=False))

Check warning

Code scanning / CodeQL

File is not always closed

File is opened but is not closed.
@needs_cartopy
def test_declarative_arrow_changes():
"""Test making a arrow plot with an arrow key."""
data = xr.open_dataset(get_test_data('narr_example.nc', as_file_obj=False))

Check warning

Code scanning / CodeQL

File is not always closed

File is opened but is not closed.
@kgoebber
Copy link
Collaborator Author

kgoebber commented Sep 4, 2022

It appears I don't have the correct version of FreeType to conform to our CI processes. Trying to search for ways to get the M1 chip to have freestyle 2.6.1. Earliest version via conda would be 2.10.4 - haven't been able to find a pip wheel that might work either...a little out of my depth on this one.

@dopplershift
Copy link
Member

😒 This macOS ARM64 + Freetype issue is going to become a problem. Luckily there's on-going work to introduce perceptual image hashing in pytest-mpl that should eliminate the need. (Otherwise I have no idea what to do unless matplotlib bumps their testing version of freetype.)

I'll regenerate the images from the PR and upload.

Copy link
Member

@dopplershift dopplershift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, just a suggestion of a better way to generate the arrowkey.

@kgoebber
Copy link
Collaborator Author

kgoebber commented Sep 8, 2022

I think my latest addition blew away the updated figures you added. Didn't find the correct incantation to grab those as part of my local PR...a bit out of my git-league.

@dopplershift
Copy link
Member

For future reference, a git pull should have pulled down the changes I pushed to the PR. No worries, though, I still have the commit locally and I can do the git surgery necessary.

This removes problems with Tuple(allow_none=True, default_value=None).
@dopplershift dopplershift added Type: Feature New functionality Area: Plots Pertains to producing plots labels Sep 9, 2022
@dopplershift dopplershift added this to the September 2022 milestone Sep 9, 2022
@dopplershift dopplershift merged commit 8a83587 into Unidata:main Sep 9, 2022
@dopplershift
Copy link
Member

@kgoebber I managed to get the testing builds for matplotlib on conda-forge to build for osx-arm64. So if you update the environment (and it's configured to use conda-forge/label/testing::matplotlib-base) you should be able to better test/generate images. @dcamron has a few image threshold tweaks to get merged in order for the test suite to pass by default.

@kgoebber
Copy link
Collaborator Author

kgoebber commented Sep 15, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Plots Pertains to producing plots Type: Feature New functionality

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

add ability to draw arrows on maps using declarative

2 participants