Skip to content

TST: Add future dependency tests as a weekly CI job #21634

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

Merged
merged 1 commit into from
Feb 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
pull_request:
branches-ignore:
- v[0-9]+.[0-9]+.[0-9x]+-doc
schedule:
# 3:47 UTC on Saturdays
- cron: "47 3 * * 6"

env:
NO_AT_BRIDGE: 1 # Necessary for GTK3 interactive test.
Expand Down Expand Up @@ -209,6 +212,20 @@ jobs:
echo 'wxPython is available' ||
echo 'wxPython is not available'

- name: Install the nightly dependencies
# Only install the nightly dependencies during the scheduled event
if: ${{ github.event_name == 'schedule' && matrix.name-suffix != '(Minimum Versions)' }}
run: |
python -m pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple --upgrade numpy pandas

# Turn all warnings to errors, except ignore the distutils deprecations and the find_spec warning
cat >> pytest.ini << EOF
filterwarnings =
error
ignore:.*distutils:DeprecationWarning
ignore:DynamicImporter.find_spec\(\) not found; falling back to find_module\(\):ImportWarning
EOF

- name: Install Matplotlib
run: |
ccache -s
Expand Down Expand Up @@ -266,3 +283,18 @@ jobs:
with:
name: "${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.name-suffix }} result images"
path: ./result_images

- name: Create issue on failure
uses: imjohnbo/issue-bot@v3
if: ${{ failure() && github.event_name == 'schedule' }}
with:
title: "[TST] Upcoming dependency test failures"
body: |
The weekly build with nightly wheels from numpy and pandas
has failed. Check the logs for any updates that need to be
made in matplotlib.

pinned: false
close-previous: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3438,6 +3438,8 @@ def test_errorbar():
ax.errorbar(x, y, yerr=[yerr_lower, 2*yerr], xerr=xerr,
fmt='o', ecolor='g', capthick=2)
ax.set_title('Mixed sym., log y')
# Force limits due to floating point slop potentially expanding the range
ax.set_ylim(1e-2, 1e1)

fig.suptitle('Variable errorbars')

Expand Down
7 changes: 4 additions & 3 deletions lib/matplotlib/tests/test_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,14 +568,15 @@ def test_Normalize():
# Don't lose precision on longdoubles (float128 on Linux):
# for array inputs...
vals = np.array([1.2345678901, 9.8765432109], dtype=np.longdouble)
norm = mcolors.Normalize(vals.min(), vals.max())
assert_array_equal(np.asarray(norm(vals)), [0, 1])
norm = mcolors.Normalize(vals[0], vals[1])
assert norm(vals).dtype == np.longdouble
assert_array_equal(norm(vals), [0, 1])
# and for scalar ones.
eps = np.finfo(np.longdouble).resolution
norm = plt.Normalize(1, 1 + 100 * eps)
# 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)
Comment on lines 577 to +579
Copy link
Member

Choose a reason for hiding this comment

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

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.



def test_FuncNorm():
Expand Down