Issue #47 - Allow Python application developers to disable quiet mode of graphLib#50
Merged
Merged
Conversation
…, i.e. Message() and ErrorMessage() will be displayed after setting quietMode to 0.
…Lib.pyx Cython module, which directly wraps every function from the C graphLib via cimport of cgraphLib.pxd. I added the graphLib.pxd so that graph.pyx and g6IterationUtils.pyx modules are able to access the functions and constants surfaced from the cgraphLib via the graphLib. You can now think of graph.pyx and g6IterationUtils.pyx as being "views" of the graphLib rather than direct wrappers themselves.
…e. Also seems to have resolved #40!!
Member
Author
|
Freakin' sweet. I think with the latest commit to update Also ran |
john-boyer-phd
requested changes
May 27, 2026
Member
john-boyer-phd
left a comment
There was a problem hiding this comment.
A fantastic advancement. I have only embarrassingly minor tweaks...
…n which they appear in cgraphLib.pxd, graphLib.pxd, and graphLib.pyx
john-boyer-phd
approved these changes
May 27, 2026
Member
john-boyer-phd
left a comment
There was a problem hiding this comment.
This is looking ALL GOOD!
This was referenced May 28, 2026
john-boyer-phd
pushed a commit
that referenced
this pull request
May 28, 2026
…from [EAPS PR #217](graph-algorithms/edge-addition-planarity-suite#217) and [EAPS PR #221](graph-algorithms/edge-addition-planarity-suite#221), and made sure all functions/methods are declared and defined in the correct order in: (#53) Closes #52 * `cgraphLib.pxd`, * `cplanarity.pxd` (no changes to `planarity/classic/planarity.pyx` needed), * `graphLib.pxd`, * `graphLib.pyx`, * `graph.pyx` Added `gp_DynamicAddEdge()` to `cgraphLib.pxd`, surfaced in `graphLib.pxd` and wrapped in `graphLib.pyx`, then added to `Graph` in `graph.pyx`. NOTE that this is not called in the EAPS testing layer at this time, so direct validation has not yet been performed. Changed order of `g6_EndReached()` in `g6ReadIterationUtils.pyx`, since this was left out of #50
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.
Message()andErrorMessage()from the C layer will be displayed after settingquietModeto 0 viagp_SetQuietModeFlag().Resolves #47 (and #40 appears to have been fixed by changes to
Manifest.in)Type of change
Please check only relevant options:
Changes
Added
examples/full/test_quiet_mode.py- Helps demonstrate use ofgp_GetQuietModeFlag()andgp_SetQuietModeFlag()exposed fromgraphLibmodule inplanarity.fullsubpackageplanarity/full/graphLib.c- compiled using Python 3.14.2 on MacOS with Cython 3.2.5planarity/full/graphLib.pxd- definition file that allows other cython modules to call wrapper functions made available in this module (i.e.graphLib.pyx). Also surfaces thegraphP,G6ReadIteratorP, andG6WriteIteratorPtypes (defined incgraphLib.pxd, corresponding to types in the C library) to other Cython modules.g6_InitReaderWithFileName()(g6_InitWriterWithFileName()only useschar *foroutputFilename) to removeconstqualifiers, since the syntaxchar const *constsupported in C isn't supported by Cython)planarity/full/graphLib.pyx- Cython module containing simple wrapper functions ofEAPSgraphLib, as well as exposinggraphLibconstants defined incgraphLib.pxd.Updated
MANIFEST.in- removed.pxddefinition files that no longer exist, addedgraphLibmodule source file, definition file, and compiled file, as well asgraph.pxddefinition file (which might have been the cause ofpython -m buildfails to build source distribution and wheel #40 , looking at the error messsageplanarity/full/graph.pyx:41:41: Cannot convert 'graphP' to Python object)setup.py- created newExtensionforgraphLib.pyxmodule, which is the extension whose sourcefiles include those in thec/graphLib/(i.e. the compiled library corresponding to this module is how we gain access to the EAPSgraphLib). So now, theplanarity.full.graphandplanarity.full.g6IterationUtilsExtensionsno longer need to include theplanarity/c/graphLib/in theirsources, nor to require the headers viainclude_dirs.planarity/full/cgraphLib.pxd- Added contents ofcappconst.pxdandcG6IterationDefs.pxd, and moved some of the definitions of functions and constants up to the top of thecgraphLib.pxdfile for ease of reference. Also fixedgp_GetNextEdge()andgp_GetNeighbor()parameter names to reflect the function signature in theplanarity/c/graphLib/graph.hheader.planarity/full/g6IterationUtils.pyx- nowcimports thegraphLibmodule in order to access the functions defined incgraphLib.pxdvia the wrappers ingraphLib. AlsoimportsgraphLibto get access to the constants fromplanarity/c/graphLib/(e.g.OK)planarity/full/graph.pyx- nowcimports thegraphLibmodule in order to access the functions defined incgraphLib.pxdvia the wrappers ingraphLib. AlsoimportsgraphLibto get access to the constants fromplanarity/c/graphLib/(e.g.OK). Removedgp_GetProjectVersionFull()andgp_GetLibPlanarityVersionFull()wrappers, which belong to the wholegraphLib.planarity/full/graph.pxdwecimportgraphLibto gain access to the definition forgraphP(i.e. viagraphLib.pxd)planarity/__init__.py- now,graphLib.pyxmodule is that which suppliesgp_GetQuietModeFlag(),gp_SetQuietModeFlag(),gp_GetProjectVersionFull(), andgp_GetLibPlanarityVersionFull(), as well as all the constants (e.g.OK), so those are the only module members surfaced viaplanaritypackage's__init__.pyplanarity/classic/planarity.c,planarity/full/g6IterationUtils.c,planarity/full/graph.c- recompiled using Python 3.14.2 on MacOS with Cython 3.2.5Removed
planarity/full/cappconst.pxd,planarity/full/cg6IterationDefs.pxd, since these definitions were moved intocgraphLib.pxdandgraphLib.pyxonlycimportscgraphLibChangenotes for previous iteration
Added
examples/full/quiet_mode_test.py- For this test to be meaningful, you must add aMessage()and/orErrorMessage()to the CgraphLiblayer ingp_New()so that when we initialize theGraphinstances and__cinit__()callsgp_New(), we'll see that the messages are not displayed by default, but then once the global variablequietModeFlagis updated via
gp_SetQuietModeFlag(), the messages are displayed.planarity/full/capiutils.pxd- added definitions forgp_GetQuietModeFlag()andgp_SetQuietModeFlag()inplanarity/c/graphLib/lowLevelUtils/apiutils.hUpdated
planarity/__init__.py- exposedgp_GetQuietModeFlag()andgp_SetQuietModeFlag()fromplanarity/full/graph.pyxplanarity/full/graph.pyx- added definitions for functionsgp_GetQuietModeFlag()andgp_SetQuietModeFlag()which call down to the correspondinggraphLibfunctions defined inplanarity/full/capiutils.pxdplanarity/full/g6IterationUtils.candplanarity/full/graph.c- regenerated on MacOS Tahoe (26.3.1) using Python 3.14 withCython==3.2.4andsetuptools==82.0.1Removed
Testing
Running test_quiet_mode.py when an invalid filename is given to initialize the G6ReadIterator