Skip to content

fix: fall back to python pagerank when scipy is missing#4970

Open
MobiusL00p wants to merge 1 commit intoAider-AI:mainfrom
MobiusL00p:fix-pagerank-scipy-fallback
Open

fix: fall back to python pagerank when scipy is missing#4970
MobiusL00p wants to merge 1 commit intoAider-AI:mainfrom
MobiusL00p:fix-pagerank-scipy-fallback

Conversation

@MobiusL00p
Copy link
Copy Markdown

Summary

  • catch ModuleNotFoundError from networkx.pagerank() when the scipy-backed implementation is unavailable
  • fall back to NetworkX's pure-Python PageRank implementation so repo map generation still works
  • add a regression test that simulates missing scipy and verifies the fallback path is used

Verification

  • python -m pytest tests/basic/test_repomap.py -k scipy
  • python -m pytest tests/basic/test_repomap.py -k "scipy or get_repo_map_excludes_added_files or get_repo_map_with_identifiers"
  • python -m compileall aider/repomap.py tests/basic/test_repomap.py

Closes #4962.

@MobiusL00p MobiusL00p force-pushed the fix-pagerank-scipy-fallback branch from 1c7ef31 to a6579c9 Compare March 31, 2026 11:17
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.

Uncaught ModuleNotFoundError in pagerank_alg.py line 454

1 participant