Skip to content

VisibleDeprecationWarnings in test_given_colors_levels_and_extends #7334

Closed

Description

@QuLogic

On Travis, the test_given_colors_levels_and_extends test is generating two VisibleDeprecationWarnings:

.../matplotlib/colorbar.py:539: VisibleDeprecationWarning:
 boolean index did not match indexed array along dimension 0; dimension is 5 but corresponding boolean dimension is 4
  colors = np.asarray(colors)[igood]
.../matplotlib/colorbar.py:539: VisibleDeprecationWarning:
 boolean index did not match indexed array along dimension 0; dimension is 5 but corresponding boolean dimension is 3
  colors = np.asarray(colors)[igood]

The first occurs on the axes that is not filled and extend='min'; the second with unfilled and extend='both'. The passed colour list is 5 elements long and the levels list is 4 or 3. The warning can easily be fixed by trimming the colour list, but I'm not sure exactly where that should be.

I guess I'm not entirely sure why one less level is passed for extend='both' when only unfilled. cc @pelson who wrote the test

Activity

  1. added this to the milestone on Oct 24, 2016
  2. pelson commented on Nov 22, 2016

    @pelson
    Member

    I'm sure it is developer error, rather than anything meaningful. Looks like there was an oversight of "both" for filled in

    last_color = -1 if extend in ['min', 'max'] else None
    , and for min/max in non-filled at
    last_level = -1 if extend == 'both' else None
    .

  3. NelleV commented on Nov 22, 2016

    @NelleV
    Member

    @pelson can you open a PR fixing that? :D

  4. pelson commented on Nov 22, 2016

    @pelson
    Member

    @pelson can you open a PR fixing that? :D

    Realistically, unfortunately not at the moment 😞 .

  5. NelleV commented on Nov 22, 2016

    @NelleV
    Member

    :(

  6. pelson commented on Nov 24, 2016

    @pelson
    Member

    I know. Sad face from me too...

    screen shot 2016-11-23 at 07 03 05

    I'm sure it will turn around - it is just the growth of conda-forge that has swamped my time 😉

  7. QuLogic commented on Dec 7, 2016

    @QuLogic
    MemberAuthor

    On further inspection, I'm not sure whether this is solely an error in the test. Removing colours from the input list still produces the same warning, so something in the contour itself is producing the wrong number of colours to be passed to the colorbar.

  8. dstansby commented on Mar 19, 2017

    @dstansby
    Member

    Doesn't look like this is happening on current master any more: https://travis-ci.org/matplotlib/matplotlib/jobs/212484661

  9. QuLogic commented on Mar 19, 2017

    @QuLogic
    MemberAuthor

    Pytest doesn't show warnings by default.

  10. modified the milestones: , on May 3, 2017
  11. dstansby commented on Jun 12, 2017

    @dstansby
    Member

    Closed by #8737

  12. modified the milestones: , on Jun 12, 2017
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