Skip to content

feat(rs): add balance indices (sackin, leaf depth variance, b2)#187

Merged
Neclow merged 6 commits intosbhattlab:mainfrom
Neclow:feat/balance-indices
Feb 6, 2026
Merged

feat(rs): add balance indices (sackin, leaf depth variance, b2)#187
Neclow merged 6 commits intosbhattlab:mainfrom
Neclow:feat/balance-indices

Conversation

@Neclow
Copy link
Collaborator

@Neclow Neclow commented Feb 6, 2026

Add new balance module with tree balance/imbalance indices:

  • Sackin index (sum of leaf depths)
  • Leaf depth variance
  • B2 index (Shao & Sokal 1990)

Includes comprehensive tests with ladder and balanced tree cases.

Add new balance module with tree balance/imbalance indices:
- Sackin index (sum of leaf depths)
- Leaf depth variance
- B2 index (Shao & Sokal 1990)

Includes comprehensive tests with ladder and balanced tree cases.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new vector::balance module providing common rooted-binary tree balance/imbalance indices computed from Phylo2Vec vectors.

Changes:

  • Introduces sackin, leaf_depth_variance, and b2 metrics under phylo2vec::vector::balance.
  • Adds rstest-based test coverage for ladder vs balanced tree extremal/known values.
  • Updates the codespell whitelist for the term “sackin”.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
phylo2vec/src/vector/mod.rs Exposes the new balance module from vector.
phylo2vec/src/vector/balance.rs Implements balance indices and adds unit tests.
.codespell-whitelist Whitelists “sackin” to avoid codespell false positives.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Neclow and others added 4 commits February 6, 2026 18:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Neclow Neclow merged commit 136df91 into sbhattlab:main Feb 6, 2026
9 checks passed
@Neclow Neclow deleted the feat/balance-indices branch February 6, 2026 17:46
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

Comments