| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| run: | | ||
| xvfb-run -a python -mpytest -raR -n auto \ | ||
| --maxfail=50 --timeout=300 --durations=25 --log-level=DEBUG \ | ||
| -W error::UserWarning |
There was a problem hiding this comment.
We actually would like to see the DeprecationWarning's as well (-W error without the specific UserWarning), but on Python 3.10 Numpy's testing import causes deprecation warnings due to the distutils future removal in Python 3.12. So, we would have to wait for Numpy's removal of distutils before we did that. Unless I'm missing a way to catch a specific string of deprecation warnings so we could ignore only that specific warning.
Sorry, something went wrong.
There was a problem hiding this comment.
Sure, you can be more specific with warnings filters: https://docs.python.org/3/library/warnings.html#describing-warning-filters
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for pointing that out. I tried a few things out and it was more complicated that I hoped.
See here for other discussion: https://bugs.python.org/issue43862
While the Python API warnings.filterwarnings(action, message="", ...) uses the message as a regular expression, -W and PYTHONWARNINGS require to match exactly the whole message.
I got one match, and then another import failed, so not sure how many options/messages we want to match on if we do. I couldn't figure out how to use the "module" piece either, I thought that could refer to errors raise from distutils directly, or even by putting numpy.testing in there for where the warnings were arising from, but neither of those worked for me...
In summary, I'd leave it with the UserWarning -> Error for now and deal with DeprecationWarnings after Numpy fixes their distutils imports.
Sorry, something went wrong.
There was a problem hiding this comment.
Alternatively, you could change pytest.ini to ignore what you want, as it seems to support regex.
cat >> pytest.ini <<EOF
filterwarnings =
error:message:DeprecationWarning
EOF
Sorry, something went wrong.
|
I think some of the 3.10 + numpy-1.22.dev failures are fixed on numpy's default branch (at one point I was seeing issuse with distutils warnings, but they are gone for me locally). I am in principle 👍🏻 👍🏻 on this idea! |
Sorry, something went wrong.
|
Looks like the test suite is passing with the nightly pandas and numpy wheels now. https://github.com/greglucas/matplotlib/runs/4290939395?check_suite_focus=true |
Sorry, something went wrong.
| run: | | ||
| xvfb-run -a python -mpytest -raR -n auto \ | ||
| --maxfail=50 --timeout=300 --durations=25 --log-level=DEBUG \ | ||
| -W error::UserWarning |
There was a problem hiding this comment.
Alternatively, you could change pytest.ini to ignore what you want, as it seems to support regex.
cat >> pytest.ini <<EOF
filterwarnings =
error:message:DeprecationWarning
EOF
Sorry, something went wrong.
|
Some of the tests seem to be a little flaky when they are run: https://github.com/greglucas/matplotlib/actions/runs/1495511858 |
Sorry, something went wrong.
|
I pushed a local copy of this up to my fork: https://github.com/greglucas/matplotlib/runs/4621007693?check_suite_focus=true |
Sorry, something went wrong.
|
The result images should be obtainable on the Summary page. It doesn't look like the failures are anywhere other than test images. |
Sorry, something went wrong.
|
Yep, I did download them and couldn't find any obvious reason for the failures (they are all quite small). The largest one test_errorbar has an expanded y-limit, causing the number of ticks to be increased, but the data in the plot appears to be correct. My initial guess is that the failures are due to floating point discrepancies, causing a ylim to be expanded to the next decade, but I'm not sure where that would be coming from since I can't reproduce locally. |
Sorry, something went wrong.
|
Putting some more notes down here: I can't reproduce these failures on a local macosx or ubuntu machine either, so my debugging capability here is limited unfortunately. |
Sorry, something went wrong.
|
Perhaps this is related to AVX512 instructions now being available in the wheel... On the 3.8-3.10 runners: Supported SIMD extensions in this NumPy install:
baseline = SSE,SSE2,SSE3
found = SSSE3,SSE41,POPCNT,SSE42,AVX,F16C,FMA3,AVX2,AVX512F,AVX512CD,AVX512_SKX
not found = AVX512_KNL,AVX512_KNM,AVX512_CLX,AVX512_CNL,AVX512_ICL
On the 3.7 runner (numpy 1.21): Supported SIMD extensions in this NumPy install:
baseline = SSE,SSE2,SSE3
found = SSSE3,SSE41,POPCNT,SSE42,AVX,F16C,FMA3,AVX2
not found = AVX512F,AVX512CD,AVX512_KNL,AVX512_KNM,AVX512_SKX,AVX512_CLX,AVX512_CNL,AVX512_ICL
My local Ubuntu is on a chip without AVX512 instructions, which could explain why I'm not able to reproduce this locally. If someone does have a system with a chip that supports AVX512 and could test locally that could verify this guess: python -c "import numpy; numpy.show_config()" |
Sorry, something went wrong.
I suspect this is correct - I'm seeing similar small floating point differences on another project that seems to be related to both numpy version and the specific machine CI is being run on. |
Sorry, something went wrong.
|
I decided to rework this and incorporate it into the current tests.yml file, which seems better than trying to maintain two copies of the CI file. There are new floating-point issues that cropped up again in Normalize with longdouble. It must be a new numpy optimization in .min(), as specific item-access works, so I've updated the tests to account for these changes. |
Sorry, something went wrong.
Test future numpy and pandas versions with Matplotlib to see if anything needs to be done in the future to address deprecations or other pending changes. Turns all warnings into errors, but filters out the distutils deprecation and find_spec warnings.
| # This returns exactly 0.5 when longdouble is extended precision (80-bit), | ||
| # but only a value close to it when it is quadruple precision (128-bit). | ||
| assert 0 < norm(1 + 50 * eps) < 1 | ||
| np.testing.assert_array_almost_equal_nulp(norm(1 + 50 * eps), 0.5) |
There was a problem hiding this comment.
This seems to be a bit too strict now, as it is failing on aarch64, ppc64le, and s390x, where the result is 0.50096339.
Also, on my 64-bit AMD system, which is apparently using np.float128 for np.longdouble (though I don't know if that means 80-bit internally), it seems to return 0.5 exactly, which seems the opposite of the comment.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
Test future numpy versions with Matplotlib to see if anything needs to be done in the future to address deprecations
or other pending changes.
Link to a run on my branch (it should only run on matplotlib/matplotlib now)
https://github.com/greglucas/matplotlib/runs/4204821100?check_suite_focus=true
3.9 + numpy-1.22.dev failures
FAILED lib/matplotlib/tests/test_units.py::test_plot_masked_units[png] - matp... = 1 failed, 8352 passed, 148 skipped, 13 xfailed, 4 xpassed in 537.93s (0:08:57) =3.10 + numpy-1.22.dev failures
FAILED lib/matplotlib/tests/test_axes.py::test_errorbar[png] - matplotlib.tes... FAILED lib/matplotlib/tests/test_axes.py::test_errorbar[svg] - matplotlib.tes... FAILED lib/matplotlib/tests/test_axes.py::test_errorbar[pdf] - matplotlib.tes... FAILED lib/matplotlib/tests/test_backends_interactive.py::test_webagg - Asser... FAILED lib/matplotlib/tests/test_units.py::test_plot_masked_units[png] - matp... FAILED lib/matplotlib/tests/test_streamplot.py::test_direction[png] - matplot... FAILED lib/mpl_toolkits/tests/test_axisartist_grid_helper_curvelinear.py::test_axis_direction[png] FAILED lib/mpl_toolkits/tests/test_mplot3d.py::test_trisurf3d[png] - matplotl... FAILED lib/mpl_toolkits/tests/test_mplot3d.py::test_stem3d[png] - matplotlib.... = 9 failed, 8344 passed, 148 skipped, 13 xfailed, 4 xpassed, 4 warnings in 414.94s (0:06:54) =Additional things to consider
Perhaps we should also consider adding a nightly cibuildwheel to that repository for others to test out Matplotlib and report back to us easier?
PR Checklist
Tests and Styling
Documentation