Skip to content

ogdf-py 0.1.1

Choose a tag to compare

@shakfu shakfu released this 06 Jul 05:16
· 24 commits to main since this release

Python bindings for the Open Graph Drawing Framework (OGDF), built with nanobind.

This is a curated subset of OGDF, not a full wrapper: enough to build graphs, run layout and core graph algorithms, style and draw them, and read/write common graph file formats.

[0.1.1]

Added

  • OGDF bindings (curated subset): Graph/Node/Edge with iteration; NodeArray/EdgeArray in int/double/bool; GraphAttributes with coordinates, size, labels, and styling (colors, shapes, fill patterns, stroke, edge arrows, bends).

  • Layout algorithms: SugiyamaLayout, FMMMLayout, GEMLayout, SpringEmbedderKK, StressMinimization, PivotMDS, PlanarizationLayout (with optional orthogonal routing), SchnyderLayout, TreeLayout, CircularLayout.

  • Core graph algorithms: connectivity/structure predicates, connected / strong / biconnected components, topological numbering, Dijkstra shortest paths, minimum spanning tree, maximum flow, global minimum cut, matching, node coloring, and planar embedding.

  • Graph generators: complete, complete-bipartite, wheel, cube, grid, Petersen, regular tree, plus random graphs, trees, digraphs, and regular / biconnected / planar variants.

  • File I/O: interchange formats GML, GraphML, DOT, GEXF, GDF, TLP (with extension-based read/write) and drawing output as SVG and TikZ.

  • demos/ folder with illustrative scripts (layout gallery, styling showcase, algorithm visualizations, generator zoo, I/O round-trips) writing to build/demo-output; make demos also builds a self-contained HTML gallery (index.html) of every drawing.

  • Bindings split into modular translation units (bind_graph, bind_layouts, bind_algorithms, bind_io, bind_generators).

  • Auto-generated _core.pyi type stub for typed usage and IDE completion.

  • cibuildwheel release workflow building CPython 3.10-3.13 wheels for Linux (x86_64, aarch64) and macOS (x86_64, arm64) on native runners, bootstrapping OGDF once per platform; trusted-publishing jobs for TestPyPI/PyPI on tags.

  • CMake auto-bootstraps OGDF if missing, so pip install from an sdist works without a manual step (Unix only).

Changed

  • Reproducible OGDF dependency: scripts/bootstrap_ogdf.sh shallow-clones OGDF at a pinned tag (foxglove-202510) and builds its static libraries from source; the extension links them. make build/make sync auto-bootstrap if needed. Replaces reliance on a manually placed OGDF checkout.

  • Persist the CMake build directory so only the bindings recompile on edits.

Fixed

  • make build targeted the wrong package name (ogdf vs ogdf-py), making it a silent no-op; it now rebuilds correctly.

  • The generic write now raises ValueError for attribute-incapable formats (e.g. LEDA, Chaco) instead of crashing the interpreter.

[0.1.0]

Added

  • Initial project structure

  • Core module with example functions

  • Test suite with pytest

  • Build system using scikit-build-core