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
Path.contains_points() returns a uint8 array instead of a bool array #3824
Conversation
I can confirm this. It works as intended in 1.4.2 so it seems likely to be a result of the c++ refactor. |
Fix attached. |
3c4145b
to
2c1bc6b
Compare
} | ||
} | ||
inside_flag[i] |= subpath_flag[i]; | ||
if (inside_flag[i] == 0) { | ||
inside_flag[i] = inside_flag[i] || subpath_flag[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this one necessary? (Don't change it, I'm just curious)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In C++ the |
operator is not valid on bool
, and ||=
does not exist. So AFAICT, you have to do something like this.
Path.contains_points() returns a uint8 array instead of a bool array
👍 - swift @mdboom. Thanks for reporting @alimuldal. It's not often a bug goes from reported to merged in < 2 hours 😉 |
Awesome, thanks guys |
According to the docs,
matplotlib.path.Path.contains_points()
ought to return a boolean array, but it currently returns a uint8 array. It looks like this API change was introduced in ba40160. It caught me out when I tried to use the result ofcontains_points()
as a boolean index to another array.