Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG : fix _reshape_2D bug with [(n, 1), ..] input #3284

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

Merged
merged 1 commit into from
Jul 24, 2014

Conversation

tacaswell
Copy link
Member

cbook._reshape_2D the input can be at most 2D, however if it
is passed a list of (n, 1) shaped ndarray this condition will
be violated and it fails to work (which is less than great, but
fine from a documentation stand point). However, boxplot used
to work with a list of such ndarrays (and users might expect to
call a (n, 1) shaped array a 1D array). The added ravel makes
sure that even if we get a list of any dimensional ndarrays in, the
output will be a list of (n, ) shaped arrays.

Closes #3220

cbook._reshape_2D the input can be _at most_ 2D, however if it
is passed a list of (n, 1) shaped ndarray this condition will
be violated and it fails to work (which is less than great, but
fine from a documentation stand point).  However, boxplot _used_
to work with a list of such ndarrays (and users might expect to
call a (n, 1) shaped array a 1D array).  The added `ravel` makes
sure that even if we get a list of any dimensional ndarrays in, the
output will be a list of (n, ) shaped arrays.

Closes matplotlib#3220
@tacaswell tacaswell added this to the v1.4.0 milestone Jul 22, 2014
@tacaswell
Copy link
Member Author

I will try to pull tests together for _reshape_2D tomorrow, however I don't want to hold up the release on these tests.

@phobson Comments?

@WeatherGod
Copy link
Member

Note to self... this function needs serious commenting. Furthermore this function (as well as others elsewhere) will need to be updated to properly account for len()-able data types that don't implement __len__ (single-dispatch stuff in py3k).

As far as I can tell, this makes sense.

@WeatherGod
Copy link
Member

This is set to merge into master, not 1.4.x. Was that intentional?

@tacaswell
Copy link
Member Author

nope, product of doing this too late at night. I can make a new PR targeted at 1.4, one of use can do the merged to 1.4 locally and then merge to master (which will auto-close this), or we can cherry-pick. Up to you @WeatherGod

@WeatherGod
Copy link
Member

It is just a single commit. I'll cherry-pick it to 1.4.x after merging to master.

WeatherGod added a commit that referenced this pull request Jul 24, 2014
BUG : fix  _reshape_2D bug with [(n, 1), ..] input
@WeatherGod WeatherGod merged commit 1a87326 into matplotlib:master Jul 24, 2014
WeatherGod added a commit that referenced this pull request Jul 24, 2014
BUG : fix  _reshape_2D bug with [(n, 1), ..] input
@WeatherGod
Copy link
Member

Done

@tacaswell tacaswell deleted the cbook_bxpstats_fix branch July 24, 2014 19:57
jbmohler pushed a commit to jbmohler/matplotlib that referenced this pull request Aug 14, 2014
BUG : fix  _reshape_2D bug with [(n, 1), ..] input
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pylab_examples/boxplot_demo.py crashes
2 participants