You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VisibleDeprecationWarnings in test_given_colors_levels_and_extends #7334
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
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.
Activity
pelson commentedon 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
matplotlib/lib/matplotlib/tests/test_contour.py
Line 199 in 07adcde
matplotlib/lib/matplotlib/tests/test_contour.py
Line 203 in 07adcde
NelleV commentedon Nov 22, 2016
@pelson can you open a PR fixing that? :D
pelson commentedon Nov 22, 2016
Realistically, unfortunately not at the moment 😞 .
NelleV commentedon Nov 22, 2016
:(
pelson commentedon Nov 24, 2016
I know. Sad face from me too...
I'm sure it will turn around - it is just the growth of conda-forge that has swamped my time 😉
QuLogic commentedon 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 commentedon Mar 19, 2017
Doesn't look like this is happening on current master any more: https://travis-ci.org/matplotlib/matplotlib/jobs/212484661
QuLogic commentedon Mar 19, 2017
Pytest doesn't show warnings by default.
dstansby commentedon Jun 12, 2017
Closed by #8737