Skip to content

Consistency of the radius argument for Path.points_in_path#2915

Merged
tacaswell merged 3 commits into
matplotlib:masterfrom
simongibbons:master
Apr 3, 2014
Merged

Consistency of the radius argument for Path.points_in_path#2915
tacaswell merged 3 commits into
matplotlib:masterfrom
simongibbons:master

Conversation

@simongibbons
Copy link
Copy Markdown
Contributor

Currently the documentation for the Path.points_in_path method implies that you can call it with a negative radius to shrink the path when making the comparison.

The code doesn't behave in that way, so here is a pull request which should fix it. If it does break something then the documentation should be updated.

Updated the points_in_path method to allow negative radii as is implied by the documentation.
@mdboom
Copy link
Copy Markdown
Member

mdboom commented Mar 21, 2014

👍

@tacaswell tacaswell added this to the v1.4.0 milestone Mar 21, 2014
@pelson
Copy link
Copy Markdown
Member

pelson commented Mar 27, 2014

Looks good. Any chance of a test case to cover this, otherwise it is likely to get broken again.

@simongibbons
Copy link
Copy Markdown
Contributor Author

There's the test case.

The Travis CI build seems to have failed though, the test I added now passes so I can't quite see what I've done wrong?

Comment thread lib/matplotlib/tests/test_path.py Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you also add a point which would be inside of the unit circle, but not inside of the unit circle with a radius of 0.5 (e.g. (0.9, 0.9)). I may have missed what radius actually does, so if my comment doesn't make any sense, please feel free to enlighten me 😉

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

P.S. It's incredibly picky I know, but would you mind removing the spaces between the keyword i.e.:

np.all(path.contains(points, radius=-0.5)...

@pelson
Copy link
Copy Markdown
Member

pelson commented Mar 27, 2014

The Travis CI build seems to have failed though

I think an update to the pep8 tool on pypi has triggered master's tests to fail - this is being dealt with, so don't worry about those.

This is looking good IMHO 👍

tacaswell added a commit that referenced this pull request Apr 3, 2014
Consistency of the radius argument for Path.points_in_path
@tacaswell tacaswell merged commit 655f3c0 into matplotlib:master Apr 3, 2014
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.

5 participants