Issue #46 - bump planarity/c/graphLib/ to match EAPS graphLib as of HEAD of master#49
Merged
Merged
Conversation
…to Cython wrapper
…now uses the updated endpoints. Will revert pyproject.toml + setup.py when updates are made to the planarity.full subpackage. It's important to note that now, cgraphLib.gp_UpperBoundVertices() is meant to be used with < rather than <= for comparisons with the index of a vertex, so when iterating over vertices, no longer does the range()'s end have to be one greater than gp_GetLastVertex() to ensure the inclusion of the final vertex's index in the immutable sequence returned by range(). Also of note is that previously, we were casting the pointer to the context as a void * rather than void **, even though that's what is actually expected by cgraphLib.gp_FindExtension()... I fixed the cdef in cplanarity.pxd to match the actual function signature, and updated the cast in planarity.pyx 's PGraph class' nodes() and edges() methods.
…all_graphs.py and edge_deletion_analysis.py. A lot of reorganization to try to ensure the declarations in the .pxd definition files appear in roughly the same order in which they appear in the graphLib headers, and ensuring Graph methods are renamed with updated calls via cgraphLib
…s in the source distribution. I have no idea why the 0.7.11 source distribution included the headers but recent attempts did not. I tried old versions of setuptools and build packages to see if something changed with these packages, but this change now means the headers are present. Related to pypa/setuptools#1162 Confirmed successful install in test environment
john-boyer-phd
requested changes
May 19, 2026
Member
john-boyer-phd
left a comment
There was a problem hiding this comment.
Looking great, minor tweaks
…populating the graph, and updated all return value checks so that we error out when staus != cplanarity.OK (rather than == cplanarity.NOTOK) Re-ran pytest + all examples/classic/ scripts
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 #46
Type of change
Please check only relevant options:
Changes
Added
Updated
planarity/c/graphLib/toHEADof EAPSmaster, which incorporate EAPS PR#214 and EAPS PR#214MANIFEST.in- addedrecursive-include planarity/c/ *.hso that header files would be included in source distribution tarball (as per this recommendation onsetuptoolsIssue #1162)planarity/__init__.py- bumped version for subsequent testing to TestPyPI (will be updated to 1.0 when we do the release)planarity/classic/cplanarity.pxd,planarity/full/cgraphLib.pxd- updated definition files to match new function and macro names ingraphLib, and rearranged so that the headers are listed in alphabetical order and the declarations match the location in which they are declared in their respective headers.planarity/classic/planarity.c,planarity/full/g6IterationUtils.c,planarity/full/graph.c- regenerated on MacOS Tahoe (26.3.1) using Python 3.14 withCython==3.2.4andsetuptools==82.0.1planarity/classic/planarity.pyx- sincegp_FindExtension()technically expects avoid **, I updated the definition inplanarity/classic/cplanarity.pxdand changed the cast of the context innodes()andedges(). Also used new names forgp_GetFirstVertex()(i.e.gp_LowerBoundVertices()) andgp_GetLastVertex()(i.e.gp_UpperBoundVertices()), and since these are meant for iteration bounds, it is now appropriate for therange()to not include the value returned (i.e. remove the+1for value assigned tolast). Finally, updatedPGraph's__init__()so that it usesgp_DynamicAddEdge()when populating the graph, and updated all return value checks so that we error out whenstaus != cplanarity.OK(rather than== cplanarity.NOTOK)self.embeddinginembed_planar()method; if the result ofgp_Embed()isNOTOK, this evaluates to 0 (rather thanOK(1) orNONEMBEDDABLE(-1), which are both truthy), so someone might just try togp_Embed()again if the graph is in an error state rather than having never hadgp_Embed()run on itplanarity/full/g6IterationUtils.pyx- removed errant tabplanarity/full/graph.pyx- reorganizedGraphmethods so that they appear in the same order in which the functions/macros they wrap appear in the.pxddefinition file, and use updated function + macro namesRemoved
Testing
python -m build --sdistand published to TestPyPI usingpython -m twine upload --repository testpypi dist/planarity-0.7.13.tar.gz, then installed to clean test virtual environment usingpython -m pip install --index-url https://test.pypi.org/simple/ --no-deps --no-build-isolation planarity(after installingsetuptools), then ran throughexamples/scripts, ranpytest, and rantest_all_graphs.pyin (currently private) EAPS-T repoReplace with high-level description of log snippets
Details