Repository navigation
Closed
Labels
BugUpstream Action RequiredWas: Upstream Fix RequiredWas: Upstream Fix Requiredtestingvisualization.wcsaxes
Milestone
Description
UPDATE:
- When upstream issue is resolved, undo TST: Patch failing tests caused by mpl-dev #11292
platform linux -- Python 3.7.3, pytest-6.2.1, py-1.10.0, pluggy-0.13.1
cachedir: .tox/py37-test-image-mpldev/.pytest_cache
Matplotlib: 3.3.2+2191.gb52aad8
Freetype: 2.6.1
Running tests with Astropy version 4.3.dev531+gfc941c3.
Running tests in astropy docs.
Date: 2021-01-22T11:27:05
Platform: Linux-4.15.0-1077-aws-x86_64-with-debian-stretch-sid
Executable: /root/project/.tox/py37-test-image-mpldev/bin/python
Full Python Version:
3.7.3 (default, Jan 9 2020, 12:06:30)
[GCC 5.4.0 20160609]
encodings: sys: utf-8, locale: UTF-8, filesystem: utf-8
byteorder: little
float info: dig: 15, mant_dig: 15
Package versions:
Numpy: 1.19.5
Scipy: not available
Matplotlib: 3.3.2+2191.gb52aad8
h5py: not available
Pandas: not available
PyERFA: 1.7.1.1
Cython: not available
Scikit-image: not available
asdf: not available
Using Astropy options: remote_data: astropy.
...
__________________________ test_invalid_slices_errors __________________________
ignore_matplotlibrc = None
def test_invalid_slices_errors(ignore_matplotlibrc):
# Make sure that users get a clear message when specifying a WCS with
# >2 dimensions without giving the 'slices' argument, or if the 'slices'
# argument has too many/few elements.
wcs3d = WCS(naxis=3)
wcs3d.wcs.ctype = ['x', 'y', 'z']
plt.subplot(1, 1, 1, projection=wcs3d, slices=('x', 'y', 1))
with pytest.raises(ValueError) as exc:
> plt.subplot(1, 1, 1, projection=wcs3d)
E Failed: DID NOT RAISE <class 'ValueError'>
../../.tox/py37-test-image-mpldev/lib/python3.7/site-packages/astropy/visualization/wcsaxes/tests/test_misc.py:345: Failed
__________________________________ test_repr ___________________________________
ignore_matplotlibrc = None
def test_repr(ignore_matplotlibrc):
# Unit test to make sure __repr__ looks as expected
wcs3d = WCS(GAL_HEADER)
# Cube header has world coordinates as distance, lon, lat, so start off
# by slicing in a way that we select just lon,lat:
ax = plt.subplot(1, 1, 1, projection=wcs3d, slices=(1, 'x', 'y'))
assert repr(ax.coords) == EXPECTED_REPR_1
# Now slice in a way that all world coordinates are still present:
ax = plt.subplot(1, 1, 1, projection=wcs3d, slices=('x', 'y', 1))
> assert repr(ax.coords) == EXPECTED_REPR_2
E AssertionError: assert '<Coordinates... yes\n\n>' == '<Coordinates... yes\n\n>'
E Skipping 266 identical leading characters in diff, use -v to show
E Skipping 152 identical trailing characters in diff, use -v to show
E - yes
E ? ^^^
E + no
E ? ^^^
E 1
../../.tox/py37-test-image-mpldev/lib/python3.7/site-packages/astropy/visualization/wcsaxes/tests/test_misc.py:418: AssertionError
=========================== short test summary info ============================
FAILED ../../.tox/py37-test-image-mpldev/lib/python3.7/site-packages/astropy/visualization/wcsaxes/tests/test_misc.py::test_invalid_slices_errors
FAILED ../../.tox/py37-test-image-mpldev/lib/python3.7/site-packages/astropy/visualization/wcsaxes/tests/test_misc.py::test_repr
cc @astrofrog and @Cadair
Metadata
Metadata
Assignees
Labels
BugUpstream Action RequiredWas: Upstream Fix RequiredWas: Upstream Fix Requiredtestingvisualization.wcsaxes
Activity
pllim commentedon Jan 22, 2021
There were a bunch of PRs merged over at matplotlib in the last 24 hours, including matplotlib/matplotlib#19153. 🤷
[-]TST: CircleCI mpl-dev job, test_misc.py failing[/-][+]TST: mpl-dev job, test_misc.py failing[/+]astrofrog commentedon Feb 2, 2021
matplotlib/matplotlib#19153 is indeed the culprit
@lpsinger - since you authored that PR and also have an understanding of WCSAxes, do you understand why the tests here are failing? In particular I don't understand why e.g.
test_invalid_slices_errorsfails (easy to reproduce as it does not require the Docker containers) sinceplt.subplotshould make new axes, before and after your PR.astrofrog commentedon Feb 2, 2021
Oh is this the issue? (from the commit in the MPL PR)
However, if there is a subplot with a matching subplot spec, then that subplot will be returned, even if the keyword arguments with which it was created differ
That seems counter-intuitive, in the sense that Matplotlib used to not re-use the axes and now does so it is not just a removal of deprecated behaviour?
astrofrog commentedon Feb 2, 2021
I'm pretty sure this is a bug in Matplotlib so have opened matplotlib/matplotlib#19432
pllim commentedon Feb 2, 2021
Thanks for looking into this, @astrofrog ! 🙏
TST: lift xfail from tests fixed upstream in matplotlib
TST: lift xfail from tests fixed upstream in matplotlib
pllim commentedon Feb 19, 2021
@lpsinger sorted this out. Thanks!
TST: lift xfail from tests fixed upstream in matplotlib
TST: lift xfail from tests fixed upstream in matplotlib
TST: lift xfail from tests fixed upstream in matplotlib
TST: lift xfail from tests fixed upstream in matplotlib
TST: lift xfail from tests fixed upstream in matplotlib