Closed jukent closed 3 months ago
I think the first testing scheme we want to include is independent viz examples that build. First, let's take inventory of how many tests we need to add at minimum.
In util.py there are 16 different methods. In taylor.py there are 10 (external). I'll start with util.
Should these .py files formatted as in the geocat examples gallery or should they be notebooks? Removing upstream examples action, need to add infrastructure to build and add examples gallery to documentation (as done in comp).
Add example script to each function (divvy these up?):
Steps:
../../examples/add_height_from_pressure_axis
. More in-depth plotting examples that utilize this function are in the GeoCAT-Examples Gallery.’Talked to @dcamron from Metpy about what they do. He directed me to their pizel-by-pixel testing using pytest-mpl, but indicated that they were unhappy with this scheme and didn't want us to get tangled up in it as they are investigating a better solution themselves. Still posting links here for now and will try to set up a meeting to learn about what it is they do not like about these tests.
https://github.com/Unidata/MetPy/blob/main/tests/plots/test_skewt.py https://github.com/Unidata/MetPy/tree/main/tests/plots/baseline
Maybe this belongs in a different issue, but I just noticed we're not actually building the docs in the nightly CI (which just failed, but because of a connectivity fluke). It would be nice to have some sort of tests run there.
We might also want to think about something a little more robust since a few things just got caught over on geocat-examples that probably should be failing over here as well (i.e. the matplotlib 3.8 API change and the problem with sphinx-book-theme and sphinx 7).
@kafitzgerald What is the status of truncate_colormap(), xr_add_cyclic_longitudes(), and set_map_boundary() examples?
All four w/ my initials are in progress. I got a bit hung up on how best to display the colormaps, but can get back to those this week and get them in.
I'll work on the skewT one this week.
Links to matplotlib's testing scheme, from our drop in on the new developers meeting:
They do test by comparing images. The most common unexpected failure trigger comes from the fonts changing They recently changed their testing scheme, and seems like they're still figuring it out to some extent
Seems like we could have a separate repo to not swamp this one down (or have it excluded from the __init___.py somehow that has images for every keyword argument entered into our functions that we can think of.
Viz doesn't have many tests because the products are visually as expected or not, but how does matplotlib or cartopy have a testing scheme?