Skip to content
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

Added the "cleared" method to Path, and updated the path module's documentation. #2011

Merged
merged 2 commits into from May 21, 2013

Conversation

pelson
Copy link
Member

@pelson pelson commented May 15, 2013

No description provided.

Returns:
A (vertices, codes) tuple, where vertices is an array of
coordinates, and codes is an array of path codes.

Copy link
Member

Choose a reason for hiding this comment

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

Might as well do this in numpydoc format as well, while we're at it.

@pelson
Copy link
Member Author

pelson commented May 20, 2013

Ok. Think this is now ready @mdboom.

@@ -75,12 +86,16 @@ class Path(object):
LINETO = 2 # 1 vertex
CURVE3 = 3 # 2 vertices
CURVE4 = 4 # 3 vertices
CLOSEPOLY = 0x4f # 1 vertex
CLOSEPOLY = 79 # 1 vertex
Copy link
Member

Choose a reason for hiding this comment

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

Can we keep this as it was -- I know it doesn't really matter, but there are some tricks used to detect the end of paths that are made more obvious when you think of it in hex.

Copy link
Member Author

Choose a reason for hiding this comment

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

but there are some tricks used to detect the end of paths that are made more obvious when you think of it in hex

For whom? I can see the benefit for developers, but not for everyday users. I'd be happy to add a comment here to jig the readers memory, if that would suffice?

Copy link
Member

Choose a reason for hiding this comment

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

Ok -- probably simplest to leave it as a (base 10) number, then. A comment here doesn't make sense either.

@mdboom
Copy link
Member

mdboom commented May 20, 2013

I still think we should have cleaned return a Path instance -- we can bypass the constructor to make it nice and fast. It just seems unpythonic this way, to me at least.

@pelson
Copy link
Member Author

pelson commented May 20, 2013

I still think we should have cleaned return a Path instance

The two cases I can envisage with cleared both just use the codes and verts. That said, I'm happy enough to compromise and have implemented a fast constructor for Path.

Was that the kind of thing you had in mind?

@mdboom
Copy link
Member

mdboom commented May 20, 2013

Yes -- that's basically what I had in mind. I think that's handy. There may be other cases in there where this should be used instead of the constructor, but that can wait for another PR.

@pelson
Copy link
Member Author

pelson commented May 21, 2013

Should add ... here so that those things are set correctly in the result.

Nice. I've added a commit. I expect to have to rebase this PR after the deprecations PR gets merged.

@pelson
Copy link
Member Author

pelson commented May 21, 2013

Other than that, I think this PR is good to go... Thanks for being patient with me ;)

No worries. Having your invaluable feedback on this module has been great.

I'll rebase now.

@pelson
Copy link
Member Author

pelson commented May 21, 2013

Ok. Once travis does its thing, lets merge 😄

@pelson
Copy link
Member Author

pelson commented May 21, 2013

Other than the spurious test failiure from master, the tests are passing with this PR.

mdboom added a commit that referenced this pull request May 21, 2013
Added the "cleared" method to Path, and updated the path module's documentation.
@mdboom mdboom merged commit 24a635f into matplotlib:master May 21, 2013
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.

None yet

2 participants