Repository navigation
Remove Tree and TreeNode class - #944
Merged
Merged
Conversation
padix-key
force-pushed
the
phylo-networkx
branch
4 times, most recently
from
September 22, 2026 20:52
bca5c1d to
9d35734
Compare
padix-key
marked this pull request as ready for review
September 22, 2026 20:53
Merging this PR will improve performance by 50.54%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | benchmark_set_structure[cif-False] |
92.9 ms | 31.6 ms | ×2.9 |
| ⚡ | benchmark_set_structure[cif-True] |
103.5 ms | 41.7 ms | ×2.5 |
| ⚡ | benchmark_connect[connect_via_distances] |
3.2 ms | 1.7 ms | +86.5% |
| ⚡ | benchmark_serialize_pdbx[cif] |
177.7 ms | 120.4 ms | +47.58% |
| ⚡ | benchmark_infer_bond_types |
1,203 µs | 827.2 µs | +45.44% |
| ⚡ | benchmark_clustering[neighbor_joining] |
557.7 µs | 394 µs | +41.54% |
| ⚡ | benchmark_set_structure |
9.4 ms | 7 ms | +35.58% |
| ⚡ | benchmark_set_structure_with_bonds |
9.6 ms | 7.2 ms | +34.53% |
| 👁 | benchmark_match_kmer_selection[KmerTable-None] |
246.2 µs | 278.6 µs | -11.64% |
| 👁 | benchmark_match[KmerTable-None] |
294 µs | 327.6 µs | -10.28% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing padix-key:phylo-networkx (5139a12) with main (1aaf784)
Footnotes
-
14 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
padix-key
force-pushed
the
phylo-networkx
branch
from
September 23, 2026 08:50
9d35734 to
b383a7a
Compare
Trees are now represented as rooted `networkx.DiGraph` objects with integer leaf nodes and a `distance` edge attribute, replacing the Cython `Tree` and `TreeNode` classes. UPGMA and neighbor joining are implemented in Rust, with UPGMA tracking the row minima to avoid rescanning the entire distance matrix. The Newick parser is iterative, hence deeply nested trees no longer hit the recursion limit. Closes biotite-dev#903, closes biotite-dev#397
padix-key
force-pushed
the
phylo-networkx
branch
from
September 23, 2026 10:05
b383a7a to
5139a12
Compare
This branch was successfully deployed
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.
This PR migrates
biotite.sequence.phylo.neighbor_joining,biotite.sequence.phylo.upgmaandbiotite.sequence.align.align_multipletonetworkx.DiGraph, makingTree/TreeNodeobsolete. HenceTree/TreeNodeare removed.Furthermore the functions above are refactored from Cython modules into Python and Rust modules. As these are the only remaining Cython modules, the Cython setup is removed from Biotite.
Resolves #903.