Skip to content

refactor: rename Laplacian() to laplacian(), deprecating the old name - #42

Merged
petercorke merged 1 commit into
mainfrom
refactor/laplacian-lowercase
Oct 11, 2026
Merged

petercorke merged 1 commit into
mainfrom
refactor/laplacian-lowercase

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Summary

Laplacian() is renamed laplacian(); the old name remains as a deprecated alias that emits DeprecationWarning (stacklevel=2) and returns the same matrix.

By the package's convention a capitalized name denotes a class method that builds a graph (Dict, Adjacency). Laplacian is an instance method that returns a matrix, like adjacency(), incidence() and degree(), so the capital made a reader expect a constructor.

Laplacian is in 0.6.5, hence the deprecation rather than a plain rename. The .. deprecated:: 1.0 note explains why.

Callers

No use in RTB, MVTB or SMTB. The README, matrices.rst and the tests now call laplacian().

Tests

tests/test_laplacian_name.py: for both graph kinds the lowercase name is silent; the capitalized name warns, the warning points at the caller, and the result is identical.

🤖 Generated with Claude Code

A capitalized name denotes a class method that builds a graph (Dict,
Adjacency).  Laplacian is an instance method returning a matrix, like
adjacency(), incidence() and degree().  Laplacian() remains as a
deprecated alias that warns and returns the same matrix.

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 4 complexity · 0 duplication

Metric Results
Complexity 4
Duplication 0

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.

@petercorke
petercorke merged commit eb78442 into main Oct 11, 2026
12 checks passed
@petercorke
petercorke deleted the refactor/laplacian-lowercase branch October 11, 2026 23:35
@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.61%. Comparing base (6d07258) to head (ccf2987).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #42      +/-   ##
==========================================
+ Coverage   94.60%   94.61%   +0.01%     
==========================================
  Files           3        3              
  Lines        1205     1208       +3     
==========================================
+ Hits         1140     1143       +3     
  Misses         65       65              

☔ 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.

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