-
Notifications
You must be signed in to change notification settings - Fork 158
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
bug fixes, API changes, documentation #241
base: master
Are you sure you want to change the base?
Conversation
The default `dst=None` could be interpreted as a search over all edges with the argument `src_or_list` as source node. However, the default corresponded to passing the pair of source and destination nodes as the argument `src_or_list`. Confusion can be avoided by requiring two arguments in all cases. Using unpacking syntax at the call site addresses use cases where the pair of nodes originates in an iterable. Close #100.
Previously, the presence of both edges `a -> c` and `c -> a` in an undirected graph resulted in the function `get_edge` returning only one edge, namely `a -> c`.
The relevant grammar rule is `a_list: ID '=' ID [(';' | ',')] [ a_list ]`. [1] https://www.graphviz.org/doc/info/lang.html
Hi @johnyf, thanks for rebasing the
Could you rebase them and maybe split them off to one or two separate PRs? I will contact you about the other commits again later. |
Thank you for reviewing the changes. I will rebase the commits mentioned above and open another pull request. The choice "created" was to emphasize that the nodes are added for the first time after setting node defaults. About the "only to", this phrasing has also a different meaning according to the Wiktionary (item 5 in the list at https://en.wiktionary.org/wiki/only#Adverb). I use short lines to allow opening several tabs of code side by side in an editor. A line width of 72 characters for docstrings agrees with PEP 8 (https://www.python.org/dev/peps/pep-0008/#maximum-line-length). |
Ok, thanks.
Ah ok, I see. But the problem is that "created" can also be understood as the nodes being instantiated and with that meaning the statement would not be true, because the node defaults will also apply to nodes instantiated before setting the defaults, but added to the graph after setting the defaults. import pydot
g=pydot.Dot()
n1 = pydot.Node('n1')
n2 = pydot.Node('n2')
g.add_node(n2)
g.set_node_defaults(color='blue')
g.add_node(n1)
print(g)
g.write_png('test.png') digraph G {
n2;
node [color=blue];
n1;
}
I do not see how "only to" could be understood to introduce such a construction here, because the rest of the sentence does not have an infinitive verb. See the examples in that item 5 ("to lose", "to betray") and on https://en.wiktionary.org/wiki/only_to ("to discover"). My feeling says "only to" would be better here, but if you feel the opposite I won't hold up merging this PR for it. The meaning is clear enough.
Yep, thanks. |
Hi @johnyf, hope you are ok. Do you still want to provide new commits for the two commits discussed above? I sent you an email on 2020-12-22, btw. |
@johnyf: I would like to move on with pydot 1.4.2. Do you still want to rebase and change these two commits yourself? Otherwise, I propose I just rebase and merge them as you provided them and then add my further changes in subsequent commits myself. Please let me know before 2021-01-22, also if you need more time. |
I cherry-picked the following two commits to master for inclusion in pydot 1.4.2:
I will look at the rest later. Thank you and hope you are ok. Sorry for my nitpicking. |
This pull request has conflicts, please resolve those so that the changes can be evaluated. |
src
anddst
inget_edge
ImportError
, instead ofException
get_edge
dot_parser
set_node_defaults
LICENSE