fix(rust): make matrix formulation bijective#41
Merged
Neclow merged 1 commit intosbhattlab:mainfrom May 22, 2025
Merged
Conversation
…s for cherry permutations and ladderization + minor fixes
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR improves the bijectivity of the matrix formulation in Rust and enhances unit test coverage in Python by adding tests for cherry permutations and ladderization while also updating documentation and import paths.
- Updated tests: Refactored and renamed tests to separate vector and matrix validations.
- Rust changes: Modified cherry ordering functions to support branch length swapping for bijectivity.
- Other: Adjusted import paths and minor docstring updates.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| py-phylo2vec/tests/test_base.py | Updated tests for cherry permutations and ladderization; improved docstrings. |
| py-phylo2vec/phylo2vec/opt/_hc_losses.py | Updated import path to newick module. |
| py-phylo2vec/phylo2vec/metrics/pairwise.py | Revised docstring formatting. |
| py-phylo2vec/phylo2vec/base/newick.py | Minor docstring wording fix. |
| phylo2vec/src/tree_vec/ops/vector.rs | Modified cherry ordering functions to return tuple with swap indices. |
| phylo2vec/src/tree_vec/ops/matrix/mod.rs | Adjusted to incorporate branch length swaps based on new order functions. |
| phylo2vec/Cargo.toml | Incremented version number. |
Comments suppressed due to low confidence (1)
phylo2vec/src/tree_vec/ops/vector.rs:261
- The variable 'row_idxs' is referenced but not defined within the current scope of the function 'order_cherries'. Please ensure that 'row_idxs' is properly initialized before it is used to avoid potential runtime errors.
bl_rows_to_swap.push(row_idxs[i]);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #40