Skip to content

TST: mpl-dev job, test_misc.py failing #11267

Closed

Description

@pllim

UPDATE:

Example log: https://app.circleci.com/pipelines/github/astropy/astropy/3915/workflows/c3d3cbd1-dfa9-44a0-9cf6-efa363ef032c/jobs/84216

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

Activity

  1. pllim commented on Jan 22, 2021

    @pllim
    MemberAuthor

    There were a bunch of PRs merged over at matplotlib in the last 24 hours, including matplotlib/matplotlib#19153. 🤷

  2. changed the title [-]TST: CircleCI mpl-dev job, test_misc.py failing[/-] [+]TST: mpl-dev job, test_misc.py failing[/+] on Jan 25, 2021
  3. astrofrog commented on Feb 2, 2021

    @astrofrog
    Member

    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_errors fails (easy to reproduce as it does not require the Docker containers) since plt.subplot should make new axes, before and after your PR.

  4. astrofrog commented on Feb 2, 2021

    @astrofrog
    Member

    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?

  5. astrofrog commented on Feb 2, 2021

    @astrofrog
    Member

    I'm pretty sure this is a bug in Matplotlib so have opened matplotlib/matplotlib#19432

  6. pllim commented on Feb 2, 2021

    @pllim
    MemberAuthor

    Thanks for looking into this, @astrofrog ! 🙏

  7. added this to the v4.3 milestone on Feb 2, 2021
  8. added a commit that references this issue on Feb 9, 2021
    e58b986
  9. added a commit that references this issue on Feb 17, 2021
    f2163d3
  10. pllim commented on Feb 19, 2021

    @pllim
    MemberAuthor

    @lpsinger sorted this out. Thanks!

  11. added 2 commits that reference this issue on Feb 21, 2021
    2501ae5
    55449e4
  12. added a commit that references this issue on Feb 28, 2021
    4a8ec8c
  13. added a commit that references this issue on Mar 9, 2021
    6e99250
  14. added a commit that references this issue on May 3, 2021
    9c7f845
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions