Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add 'add_leaf' and 'remove_leaf' methods #38

Merged
merged 9 commits into from
Dec 10, 2024

Conversation

ayushnag
Copy link

@ayushnag ayushnag commented Nov 19, 2024

This pull request introduces several new features and improvements to the TreeVec struct in the phylo2vec library. The changes include new methods for manipulating the tree structure, additional documentation, and new tests to ensure functionality.

Enhancements to TreeVec struct:

  • phylo2vec/src/tree_vec/mod.rs: Added new methods add_leaf, remove_leaf, and from_sample to the TreeVec struct, allowing for dynamic manipulation of the tree structure.
  • phylo2vec/src/tree_vec/mod.rs: Implemented the to_newick method to convert the tree to Newick format and updated the get_ancestry method to return an Ancestry type.

Documentation improvements:

  • phylo2vec/src/tree_vec/mod.rs: Added detailed documentation for the TreeVec struct and its methods, including new, from_sample, to_newick, get_ancestry, add_leaf, and remove_leaf. [1] [2]

Test additions:

Utility functions:

  • phylo2vec/src/tree_vec/ops/vector.rs: Added utility functions find_coords_of_first_leaf, order_cherries, order_cherries_no_parents, and build_vector to support the new TreeVec methods.

Code refactoring:

These changes collectively enhance the functionality, documentation, and test coverage of the TreeVec struct, making the library more robust and easier to use.

TODOs

  • Add docs
  • Tests added
  • Tests passing

Related Issues

@lsetiawan
Copy link
Member

@ayushnag I've fixed the bugs to add leaf method. looks like now there's a merge conflict. Could you please resolve this? Thanks!

@lsetiawan
Copy link
Member

@ayushnag I went ahead and fixed the merge conflicts, now the only thing failing is the remove_leaf, which I think need to be updated.

@lsetiawan lsetiawan changed the title feat: addLeaf() and removeLeaf() feat: Add 'add_leaf' and 'remove_leaf' methods Dec 10, 2024
@lsetiawan lsetiawan marked this pull request as ready for review December 10, 2024 16:31
@lsetiawan lsetiawan self-requested a review December 10, 2024 16:32
@lsetiawan
Copy link
Member

@ayushnag Thanks for the initial codebase, I was able to quickly update the code and make it work. 😄 I think this is good now.

@lsetiawan lsetiawan merged commit c6bca51 into uw-ssec:dev Dec 10, 2024
1 check passed
@ayushnag
Copy link
Author

Thanks @lsetiawan!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants