Skip to content

ogdf-py 0.6.0

Choose a tag to compare

@github-actions github-actions released this 03 Nov 12:02
· 6 commits to main since this release

Changes since the last Release

Added

  • Pushing a release tag now creates the GitHub release, with all wheels, the sdist, and the matching CHANGELOG section as notes. Tag pushes no longer publish to TestPyPI or PyPI; a manual run of build-publish.yml does, with the testpypi and pypi inputs (both off by default). The README now gives pip install ogdf-py.

  • The project is now licensed under the GPL, version 2 or 3, with the same linking exception for COIN-OR and Tulip that OGDF grants; it was MIT. Every wheel statically links OGDF, which is GPL v2/v3, so the wheels were never distributable as MIT-only. pyproject.toml declares GPL-2.0-only OR GPL-3.0-only. Released versions keep their MIT licence.

  • Wheels ship OGDF's licence texts (LICENSE.txt, GPL v2 and v3, Minisat) under ogdf/_licenses/ogdf/. The extension links OGDF statically, so the texts must travel with the binary.

Changed

  • to_networkx returns an undirected graph unless directed=True is passed. It used to read GraphAttributes.directed, which OGDF sets to True by default, so to_networkx(g, ogdf.layout(g)) returned a DiGraph for an undirected graph. Changing OGDF's default instead would remove arrowheads from every default SVG and TikZ drawing.

  • min_spanning_tree uses Kruskal and returns a minimum spanning forest. OGDF's Prim started from the first node, so on a disconnected graph it covered one component; the docstring already promised a forest.

  • set_seed accepts [-2**31, 2**32), and new_seed() returns values in [0, 2**32) on every platform. set_seed accepted int32 only, so about half of drawn seeds raised TypeError. OGDF's randomSeed() computes in uint_fast32_t, which is 64 bits under libstdc++, so on Linux new_seed() also returned values up to about 7 * 2**32. Values outside the range raise PreconditionError (a ValueError).

Fixed

  • Inputs that broke an OGDF precondition now raise PreconditionError or InvalidGraphError instead of segfaulting, hanging, or returning a wrong result. OGDF checks its preconditions only in debug builds. Findings C1-C14 and P1 in REVIEW.md list each case; tests/test_safety.py covers them. The main classes:

    • GraphAttributes accessors, layouts, metrics, transforms and SVG/TikZ output check the attribute flags they read. A default GraphAttributes segfaulted on set_node_label.
    • A handle whose element was deleted, or whose graph was cleared or destroyed, is rejected with a TypeError (and a nanobind RuntimeWarning) instead of reading freed memory. If OGDF later reuses the address for a new element of the same kind, the old handle names that element. A side table keyed by address made array access and generators 3x slower, because each lookup missed the cache; marking the Python object invalid costs nothing per access.
    • Arrays, GraphAttributes, and node/edge arguments from a different graph are rejected. connected_components with another graph's array returned 16 for a 200000-node graph and wrote out of bounds.
    • FPPLayout, MixedModelLayout, SchnyderLayout, DominanceLayout and VisibilityLayout require a connected graph, and validate() reports it. validate() returned [] for inputs that then segfaulted.
    • Generators validate sizes, degrees, probabilities and parity, and reject aliased graph arguments. Impossible random_regular_graph and random_watts_strogatz_graph arguments looped forever; cube_graph(g, 40) overflowed to 256 nodes.
    • planar_embed_planar_graph rejects non-planar input; on K5 it added two nodes and marked the result embedded.
    • min_cost_flow checks connectivity, bounds and supply balance, and verifies OGDF's result. OGDF's Reinelt solver reports success with zero flow on a one-edge network; that now raises AlgorithmError.
    • bellman_ford no longer relaxes edges out of unreachable nodes. OGDF added edge lengths to its INT_MAX sentinel, which overflowed and gave every node downstream of an unreachable one a wrong distance. Lengths whose absolute sum reaches 2**31 - 1 are rejected.
    • NaN weights and capacities are rejected wherever negative ones were. PivotMDS.set_edge_costs(0) (an endless loop) and SugiyamaLayout.set_runs(0) are rejected.
  • make clean deleted every .so under the repository, including the 241 in .venv. It now cleans src/ only.

  • The tag trigger matched only v*, but every release tag so far is bare (0.5.1). Tag pushes never ran the publish jobs, so each release went out by manual dispatch. The trigger now matches bare tags, and make release creates them instead of v-prefixed ones. A tag that disagrees with pyproject.toml fails the sdist job before any wheel builds.

  • The two 0.5.0 strings in docs/getting-started.md are now 0.5.1, and make release rewrites them along with pyproject.toml. test_provenance_example_keys_match compares the documented package_version against the installed one, so a version bump that touches only pyproject.toml fails every wheel job at the cibuildwheel test step - after the wheels have already been built.