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

Explicitly say that arguments to Graph.plot() are forwarded #18646

Closed
nathanncohen mannequin opened this issue Jun 9, 2015 · 13 comments
Closed

Explicitly say that arguments to Graph.plot() are forwarded #18646

nathanncohen mannequin opened this issue Jun 9, 2015 · 13 comments

Comments

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented Jun 9, 2015

As reported in [1], Graph.plot() is not sufficiently explicit about the arguments it accepts.

Nathann

[1] https://groups.google.com/d/topic/sage-devel/XS0EDLqfGtI/discussion

CC: @seblabbe @jm58660

Component: graph theory

Author: Nathann Cohen

Branch/Commit: f3a61f7

Reviewer: Jori Mäntysalo

Issue created by migration from https://trac.sagemath.org/ticket/18646

@nathanncohen nathanncohen mannequin added this to the sage-6.8 milestone Jun 9, 2015
@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Jun 9, 2015

Branch: public/18646

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Jun 9, 2015

Commit: 228ff6b

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Jun 9, 2015

New commits:

228ff6btrac #18646: Explicitly say that arguments to Graph.plot() are forwarded

@nathanncohen nathanncohen mannequin added the s: needs review label Jun 9, 2015
@jm58660
Copy link
Mannequin

jm58660 mannequin commented Jun 9, 2015

comment:2

LGTM.

@jm58660
Copy link
Mannequin

jm58660 mannequin commented Jun 9, 2015

Reviewer: Jori Mäntysalo

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Jun 9, 2015

comment:3

Thanks !

@seblabbe
Copy link
Contributor

comment:4

I wanted to review this ticket this morning, but it is already positive review. I had one english comment. I don't understand the part "to which they are forwarded." in

            - This method supports any parameter accepted by
              :meth:`sage.plot.graphics.Graphics.show`, to which they are
              forwarded.

Because arguments are forwarded from show to plot not the converse. I would replace "to which" by "from which" or better erase completely "to which they are forwarded." because the user don't care much about what is forwarded where.

I let you guys decide if it is too late or not (maybe this ticket is already being merged).

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Jun 10, 2015

comment:5

Replying to @seblabbe:

I wanted to review this ticket this morning, but it is already positive review. I had one english comment. I don't understand the part "to which they are forwarded." in

            - This method supports any parameter accepted by
              :meth:`sage.plot.graphics.Graphics.show`, to which they are
              forwarded.

Because arguments are forwarded from show to plot not the converse.

Nonono. The function is Graphics.show, not Graph.show. And in particular Graph.plot forwards its arguments to Graphics.show. This is why, despite having no specific code in Graph.plot to handle "axis", that argument is accepted. Because Graphics.show knows what to make of it.

I let you guys decide if it is too late or not (maybe this ticket is already being merged).

I can remove the sentence if you prefer. In the worst case, the last commit will be ignored by Volker's script.

Nathann

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 10, 2015

Changed commit from 228ff6b to f3a61f7

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 10, 2015

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

f3a61f7trac #18646: Behead a sentence.

@seblabbe
Copy link
Contributor

comment:8

Replying to @nathanncohen:

Nonono. The function is Graphics.show, not Graph.show. And in particular Graph.plot forwards its arguments to Graphics.show. This is why, despite having no specific code in Graph.plot to handle "axis", that argument is accepted. Because Graphics.show knows what to make of it.

Ok, I see what you meant. But, I still think the last commit it a good idea to avoid confusion.

So if I understand correctly, that "forward" is done indirectly in the ugly line 910 in the method def plot(self, **kwds): of file graph_plot.py:

        G._set_extra_kwds(Graphics._extract_kwds_for_show(options))

@nathanncohen
Copy link
Mannequin Author

nathanncohen mannequin commented Jun 10, 2015

comment:9

So if I understand correctly, that "forward" is done indirectly in the ugly line 910 in the method def plot(self, **kwds): of file graph_plot.py:

Yesyes, it seems so.

Nathann

@vbraun
Copy link
Member

vbraun commented Jun 11, 2015

Changed branch from public/18646 to f3a61f7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants