Skip to content

refactor: adjacent() is the canonical name; neighbours/neighbors are aliases - #37

Merged
petercorke merged 2 commits into
mainfrom
refactor/adjacent-canonical
Oct 11, 2026
Merged

petercorke merged 2 commits into
mainfrom
refactor/adjacent-canonical

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

"Adjacent" is the graph-theory term and has one spelling, which removes the UK/US split at the root. neighbours and neighbors were two methods with duplicated bodies and docstrings, isneighbour had no US form, and adjacent had been left deprecated.

  • adjacent() is the method; neighbours and neighbors are aliases bound to it, so they are the same function and do not warn (they are spelling variants, not a different concept).
  • isadjacent() likewise, with isneighbour and isneighbor as aliases.
  • adjacent() is documented as the relation adjacency() tabulates: row i of the adjacency matrix is non-zero at the vertices g[i].adjacent() returns.
  • The package's own calls use the canonical name.

Nothing that worked before stops working; the only visible difference is that adjacent() no longer emits a DeprecationWarning.

Tests

tests/test_adjacent.py: every alias returns the same result as adjacent() for both graph kinds, including parallel edges and self-loops, and none of them warns.

🤖 Generated with Claude Code

petercorke and others added 2 commits October 12, 2026 07:49
…silent aliases

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…aliases

'Adjacent' is the graph-theory term and has one spelling, which removes the
UK/US split at the root: neighbours and neighbors were two separate methods
with duplicated bodies and docstrings, isneighbour had no US form, and
adjacent had been left deprecated.

- adjacent() is the method; neighbours and neighbors are class attributes
  bound to it, so they are the same function and do not warn
- isadjacent() likewise, with isneighbour and isneighbor as aliases
- adjacent() is documented as the relation adjacency() tabulates: row i of
  the adjacency matrix is non-zero at the vertices g[i].adjacent() returns
- the package's own calls use the canonical name

No behaviour changes, and nothing that worked before stops working; the only
visible difference is that adjacent() no longer emits a DeprecationWarning.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 12 complexity · 3 duplication

Metric Results
Complexity 12
Duplication 3

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.63%. Comparing base (f34c61e) to head (53e0bad).

Files with missing lines Patch % Lines
src/pgraph/PGraph.py 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #37      +/-   ##
==========================================
+ Coverage   93.54%   93.63%   +0.08%     
==========================================
  Files           3        3              
  Lines        1054     1053       -1     
==========================================
  Hits          986      986              
+ Misses         68       67       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@petercorke
petercorke merged commit 36fdbc8 into main Oct 11, 2026
14 checks passed
@petercorke
petercorke deleted the refactor/adjacent-canonical branch October 11, 2026 23:16
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.

1 participant