Skip to content

refactor: replace networkx with graphlib in sort_definitions - #1

Open
bananaplain wants to merge 1 commit into
mainfrom
refactor/replace-networkx-with-graphlib
Open

bananaplain wants to merge 1 commit into
mainfrom
refactor/replace-networkx-with-graphlib

Conversation

@bananaplain

Copy link
Copy Markdown
Collaborator

networkx was only used to sort concept definitions and reject cycles. graphlib from the stdlib does both.

The one behavioural change is that cycle error now lists every concept definition on one cycle instead of just printing the first two of the cycle.

sort_definitions gets its first direct tests.

@plainlang plainlang deleted a comment from linear-code Bot Sep 25, 2026
@bananaplain
bananaplain force-pushed the refactor/replace-networkx-with-graphlib branch 2 times, most recently from 3e54b21 to e494573 Compare September 29, 2026 07:29
networkx breaks on Python 3.14.1 and was only used to sort concept
definitions and reject cycles. graphlib from the stdlib does both, and
graph.py lists the cycles with Johnson's algorithm, written from the
paper without recursion. The cycle error shows every definition on
each cycle, capped at ten. sort_definitions and graph.py get direct
tests.
@bananaplain
bananaplain force-pushed the refactor/replace-networkx-with-graphlib branch from e494573 to 9cd8f66 Compare September 29, 2026 08:03

@NejcS NejcS left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation code and tests look good.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants