Conversation
vertex -> node, vertices -> nodes PEP8 spacing and tabs pytest function instead of class (class not needed here -- no imports) Moved author info to CONTRIBUTORS.rst as our new standard converted list comprehension done for side-effects to for-loop. switch to f-strings from string-format calls update setup.py to remove conflicts
Also pep8 formatting
|
I went in and made some changes to make it work with the CI, @LucaCappelletti94 I also removed the type annotations as currently we don't actively put in type annotations for code in networkx (it was also failing the |
|
@dschult @LucaCappelletti94 it would be great to get this in before 3.0 (but it's supposed to be released in 2 weeks) and I would be great to get the issues brought up (and replied) in #3591 (comment) resolved ! :) The one major thing that sticks out to me is the API of write/read of LaTeX graphs, this should follow (IMO) the generic drawing API like Users should be able to do something like: >>> G = nx.erdos_renyi_graph(10, 0.1)
>>> nx.write_latex(G, 'erdos.tex') # which creates a Adigraph object and writes to fileI would suggest that we follow the API choices in
|
|
Many of the readwrite formats allow: Another questions with latex output is whether the resulting tex file should include only the latex code for the drawing or whether it should also include the header/footer for a standalone document. Perhaps we want a keyword argument for that? Finally, @LucaCappelletti94 how likely is adigraph to continue to be supported/work from CTAN? |
|
Well the package uses old latex APIs, basically no dependencies, so I don't think it will cease to work. As per additional features, I wouldn't know, for all intents and purposes for me it is a finished job. Still, I am currently working on a rust graph library for graph machine learning things, so it is possible I'll find the need to add some new stuff there from time to time. |
|
Another API choice of Adigraph is that it stores many graphs and writes them each in a separate subfigure within a figure environment. I am assuming this is better than storing each graph as its own Adigraph because you can set drawing attributes for all the graphs at once. But our other drawing routines only draw one graph and take as inputs the drawing options. You can store these options in a dict and pass that dict into each drawing object. Current use: Alternate API: What's better? Should Adigraph be related to one graph or to one figure with potentially many graphs? |
Check not multigraph. Add example Change variable name `file` to `latex_code` inline if/else for __init__ setup
|
@LucaCappelletti94 I'm confused about the difference between "weight" and "label" for edges in adigraph. |
|
I must admit I don't recall anymore, I wrote the thing initially to drow augmenting directed graphs, so it may have to do something about that. I'll re-read how I process them in the source code and get back to you. |
|
Ah yes, basically the thing was that the whole library was initially for drawing augmenting paths on graphs, and as such, it needed the edge weights for the path when the augmenting paths feature was used, even when the weight was not displayed. |
|
@LucaCappelletti94 I've got some more questions for you about Adigraph. :}
Thanks very much! |
|
Hello @dschult, I'll go take a look at the code and let you know. As of now I don't recall. |
|
Ok so, both |
|
Awesome-- Thanks. |
|
Probably the best link for the docs for tikz styles and label positions is: The most general answer is that it can be anything previously defined as a tikz style. |
|
Yes, I would also go for linking the tikz documentation, and saying it can be just about anything supported by tikz plus adding some examples. |
|
Potentially interesting https://github.com/tardis-sn/tardis/blob/master/tardis/plasma/base.py#L354 |
|
That potentially interesting link shows code which uses a package |
|
Let's switch focus for this issue/PR to #6238 |
This code was built using the adigraph latex package available on CTAN.
It got old enough that the original repository was deleted and so was ported over to this branch.
Original pr and discussion is #3591