Issue #73 - add draw() endpoint to classic api - #81
Draft
wbkboyer wants to merge 8 commits into
Draft
Conversation
…ethod steps, and to create new `examples/classic/draw.py` to demo the code.
…ever, there appears to be a mismatch bewteen the labelling of the nodes in the .png and the ascii drawing, when considering the mapping (i.e. the edge that was removed appears in the output)
…ed() twice when calling embed_drawplanar().
…nx dependency for autodoc creation to allow for hyperlinking with networkx and python docs. Ensure doc/source/_static and doc/source/_templates directories exist in the repo to prevent sphinx errors.
…g references. This led to discovery of a few warts in existing docstrings. Additionally, can't figure out how to abbreviate `typing.Any` to `Any` in typehints such that `intersphinx` (or `napoleon`??) extension resolves and creates the hyperlink.
….classic` package's module `planarity_functions.py`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #73
Type of change
Please check only relevant options:
Changes
Added
doc/source/_static/.gitignoreanddoc/source/_templates/.gitignore- ensures that these subdirectories exist when building documentation locally.examples/classic/draw.py- after extending withDrawPlanarand producing a planar embedding, output both the ASCII rendition and the image generated by Matplotlib.Updated
setup.py- added commented-out lines forextra_compile_argsto specify for eachExtension()(e.g., enable debugNOTOKstatements via-DDEBUGflag)doc/source/conf.py- added dependencysphinx.ext.intersphinxto allow docstrings to link to external projects' documentation (i.e. both the Python docs and NetworkX haveobject.invto facilitate this linking). Also, generated docs now includeclassicAPI.planarity/full/graphLib.pyx- enclosedN.N.N.Nwith backtics ingp_GetProjectVersionFull()'s docstring to prevent erroneous submodule dot notation resolution, and for consistency did the same toN:N:Ningp_GetLibPlanarityVersionFull(). Also fixed spacing inReturns:block ofgp_GetQuietMode()'s docstring.examples/classic/networkx_draw.py- updated to use thedraw()function (moved toplanarity_functions.pyplanarity/classic/planarity_functions.py- moveddraw()function fromplanarity_networkx.pymodule, and refactored it so that it constructs aPGraphfrom the inputgraph(NOTE Need to refactor so that we just use thePGraphthat was passed in without creating a newPGraph; likely requires update toPGraph's__init__()). Then, calls thePGraph'sdraw()method.planarity/classic/planarity_networkx.py- moveddraw()function toplanarity_functions.pymoduleplanarity/classic/planarity.pyxPGraph.embedding_code_string()helper function to be used when reporting error states fromPGraphattributeembedding.cython-lintto find problems.-1for values from getters (e.g.gp_DrawPlanar_GetVertexEnd()):DrawPlanarcontext contains geometric positioning rather than vertex indices (hence why it's inappropriate to compare againstNIL).gp_Embed()twice in a rowplanarity/classic/cplanarity.pxd- fixed syntax errors, fixed return type ofgp_SortVertices(), and exposedNILfromappconst.h(even though it's not used... debating whether it should be removed for now)planarity/classic/planarity.c,planarity/full/graph.c,planarity/full/graphLib.call refreshed with Cython 3.30Removed
Testing
pytest -vvvlocally, and all existing classic API tests pass (might consider adding one fordraw(), but since the output is a.pngproduced by Matplotlib'spyplot, I'm not sure how effective such a test would be...)examples/classic/draw.pyand cross-referenced the ASCII rendition with the.pngusing themapping()make htmlfrom thedocdirectoryReplace with high-level description of log snippets