Skip to content

Weird matplotlib infinite loop Travis failure #3034

Closed

Description

@jni

I'm not sure yet whether this is reproducible, but on Py2.7 with minimal requirements (MPL 1.3.1), we are getting a maximum recursion depth error:

https://travis-ci.org/scikit-image/scikit-image/jobs/372237528#L5768

It doesn't appear to be random OR due to a new Matplotlib release, so I really don't understand why it's popping up now.

Environment variables:
WITH_PYAMG=1
MINIMUM_REQUIREMENTS=1
WITH_QT=1

The failing example is doc/examples/color_exposure/plot_ihc_color_separation.py, line 72, axis.imshow(zdh).

Activity

  1. soupault commented on Apr 28, 2018

    @soupault
    Member

    Some comments on this matter - #2977 (comment) .

  2. added
    🔧 type: Maintenance
    on Apr 28, 2018
  3. added this to the 0.15 milestone on Apr 28, 2018
  4. jni commented on Apr 29, 2018

    @jni
    MemberAuthor

    Thanks @soupault for that link! Though it does not help to resolve it. It appears to be repeatable, right? Very strange since it is an old version but a new problem. Perhaps it has to do with the Qt version? Or how Travis handles Qt might have changed?

  5. soupault commented on Apr 29, 2018

    @soupault
    Member

    it does not help to resolve it

    It doesn't, but, at least, we are all aligned now :).
    I guess there is a room for investigation: try different backends, downgrade matplotlib, etc.

  6. jni commented on Apr 29, 2018

    @jni
    MemberAuthor

    Yes. Does Travis have a docker container one can download to experiment with? Because doing this over Travis builds in pushes is painful.

  7. matthew-brett commented on Apr 29, 2018

    @matthew-brett
    Contributor

    Aha - yes - Travis does have such a container.

    Have a look at the top of the Travis-CI log, in the "Worker information" section. You should see a line like:

    instance: 349a276 travisci/ci-garnet:packer-1512502276-986baf0 (via amqp)
    

    Then run something like:

    docker run -ti --rm travisci/ci-garnet:packer-1512502276-986baf0 /bin/bash
    

    to start your own container with this image...

  8. jni commented on Apr 29, 2018

    @jni
    MemberAuthor

    Thanks @matthew-brett!!!!

  9. hmaarrfk commented on May 16, 2018

    @hmaarrfk
    Member

    @jni Honestly, I don't think we should hold the examples to the same "As compatible with old versions as possible". That makes it VERY difficult for people to actually write and contribute examples.

    Examples should be simple and readable by people with basic knowledge of python + image processing.

    My solution has been not to run the examples in communion with MINIMUM_REQUIREMENTS which I think is fair. Otherwise, you will likely have ALOT of code written to support multiple versions which makes things less readable....

    Also matplotlib 1.4.0 is the first version to claim to support python 3 (which is relevant for when scikit-image discontinues support for 2.7)

  10. tacaswell commented on May 16, 2018

    @tacaswell
    Contributor

    It looks like this is related to https://github.com/scikit-image/scikit-image/pull/2977/files#diff-2718b1161d3808601068cca87c2e8ff9L73 , that you are sharing axes across figures, that the tests are running with a non-interactive backend, and all of the plots have aspect = 1

    That you are in different figures causes https://github.com/matplotlib/matplotlib/blob/cfb6ac64578c1d9e042a55c1c62894ba0d9bf331/lib/matplotlib/axes.py#L2551-L2554 to be hit, that your are non-interactive mean draw_idle is the same as draw which causes the recursion,

    Given that the axes are different aspect ratios-on screen, I think they are trying (and failing) to match all of the constraints (aspect ratio 1, the same data limits, screen aspect ratios). I am not sure of the top of my head what the right fix is.

    I am a bit surprised that this works interactively, but there is a lot of subtle code around managing both shared axes and aspect ratio so something is breaking out of the over-constrained system (this is what box-forced used to be doing for you).

    attn @efiring

  11. efiring commented on May 16, 2018

    @efiring

    The failure is with an ancient matplotlib version. I think you should drastically raise the minimum version of mpl you require. I don't see how anyone is going to benefit from the combination of up-to-date scikit-image and ancient matplotlib.

  12. hmaarrfk commented on May 18, 2018

    @hmaarrfk
    Member

    We bumbed numpy to 2.0.0 and pillow to 4.3. This issue is no longer relevant.

  13. hmaarrfk commented on May 18, 2018

    @hmaarrfk
    Member

    Pillow needed to be bumped for jpeg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔧 type: Maintenance

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions