Skip to content

Check dimensions of arrays passed to C++, handle 0 dimensions #5274

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 4 commits into from
Oct 19, 2015

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Oct 19, 2015

This is a combination of #5264 and #5246 that doesn't require #5241, and thus should be more robust to unusual arrays that Numpy creates with 0 dimensions in the middle somewhere.

Fixes #5185

@mdboom mdboom added this to the next point release (1.5.0) milestone Oct 19, 2015
@cimarronm
Copy link
Contributor

👍

@@ -358,7 +358,7 @@ void get_path_collection_extents(agg::trans_affine &master_transform,
agg::trans_affine &offset_trans,
extent_limits &extent)
{
if (offsets.dim(0) != 0 && offsets.dim(1) != 2) {
if (offsets.size() != 0 && offsets.dim(1) != 2) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this needed changing, but it doesn't hurt aside from a vague feeling of asymmetry.

@jkseppan
Copy link
Member

👍

Should there be a note in the documentation recommending the use of size() instead of dim(0)?

@mdboom
Copy link
Member Author

mdboom commented Oct 19, 2015

I've added a comment about size(). We don't really have formal documentation about our internal C++ APIs outside of header comments.

mdboom added a commit that referenced this pull request Oct 19, 2015
Check dimensions of arrays passed to C++, handle 0 dimensions
@mdboom mdboom merged commit 8990d11 into matplotlib:master Oct 19, 2015
mdboom added a commit that referenced this pull request Oct 19, 2015
Check dimensions of arrays passed to C++, handle 0 dimensions
@mdboom
Copy link
Member Author

mdboom commented Oct 19, 2015

Backported to 1.5.x as f529327

@mdboom mdboom deleted the uninited-data2 branch November 10, 2015 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants