Skip to content

VisibleDeprecationWarnings in test_given_colors_levels_and_extends #7334

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

Closed
QuLogic opened this issue Oct 24, 2016 · 9 comments
Closed

VisibleDeprecationWarnings in test_given_colors_levels_and_extends #7334

QuLogic opened this issue Oct 24, 2016 · 9 comments
Milestone

Comments

@QuLogic
Copy link
Member

QuLogic commented Oct 24, 2016

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

@QuLogic QuLogic added this to the 2.0.1 (next bug fix release) milestone Oct 24, 2016
@pelson
Copy link
Member

pelson commented Nov 22, 2016

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
.

@NelleV
Copy link
Member

NelleV commented Nov 22, 2016

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

@pelson
Copy link
Member

pelson commented Nov 22, 2016

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

Realistically, unfortunately not at the moment 😞 .

@NelleV
Copy link
Member

NelleV commented Nov 22, 2016

:(

@pelson
Copy link
Member

pelson commented Nov 24, 2016

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 😉

@QuLogic
Copy link
Member Author

QuLogic commented Dec 7, 2016

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.

@dstansby
Copy link
Member

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

@QuLogic
Copy link
Member Author

QuLogic commented Mar 19, 2017

Pytest doesn't show warnings by default.

@dstansby
Copy link
Member

Closed by #8737

@QuLogic QuLogic modified the milestones: 2.1 (next point release), 2.0.3 (next bug fix release) Jun 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants