Skip to content

refactor(r): add docs + reorganize exported functions#157

Merged
Neclow merged 2 commits intosbhattlab:mainfrom
Neclow:reorganize_r
Oct 22, 2025
Merged

refactor(r): add docs + reorganize exported functions#157
Neclow merged 2 commits intosbhattlab:mainfrom
Neclow:reorganize_r

Conversation

@Neclow
Copy link
Collaborator

@Neclow Neclow commented Oct 21, 2025

(I finally got a better understanding of how rextendr plays with royxgen...)

This PR focuses on improving the consistency, clarity, and usability of the R interface and documentation for the phylo2vec package.

Documentation

  • Standardized the terminology throughout the code and documentation from "Phylo2Vec" to "phylo2vec" (lowercase), and clarified parameter and return value descriptions for many functions, including add_leaf, check_m, check_v, and others. This improves consistency and readability for users.
  • Enhanced and expanded Roxygen and Rd documentation for many functions, including detailed parameter and return descriptions, and improved examples. This includes new or improved documentation for functions like add_leaf, check_m, check_v, save_p2v and the newly documented check_path.
  • Updated the README and function examples to use the unified to_newick function instead of the now-unexported to_newick_from_vector and to_newick_from_matrix, simplifying the interface for converting phylo2vec objects to Newick format.

Export and NAMESPACE Clean-up:

  • Removed exports for several lower-level or redundant functions (e.g., cophenetic_from_matrix, incidence_coo, pre_precision_from_matrix, to_matrix, vcov_from_matrix, etc.) from the NAMESPACE to reduce clutter and focus the API on primary user-facing functions.

@Neclow Neclow requested a review from Copilot October 22, 2025 07:12
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

This PR refactors the R interface for the phylo2vec package by standardizing terminology from "Phylo2Vec" to "phylo2vec" (lowercase) and reorganizing the exported functions to simplify the API. The key changes include:

  • Enhanced Roxygen documentation with detailed parameter descriptions, return values, and examples
  • Consolidated the Newick conversion interface by introducing a unified to_newick() function while un-exporting the lower-level to_newick_from_vector() and to_newick_from_matrix()
  • Cleaned up NAMESPACE by removing exports for lower-level functions (e.g., cophenetic_from_matrix, incidence_coo, pre_precision_from_matrix, to_matrix, vcov_from_matrix)

Reviewed Changes

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

Show a summary per file
File Description
r-phylo2vec/src/rust/src/lib.rs Updated documentation comments to use lowercase "phylo2vec" and enhanced parameter/return descriptions; un-exported several internal functions
r-phylo2vec/R/extendr-wrappers.R Improved Roxygen documentation for exported functions and removed export tags from lower-level functions
r-phylo2vec/R/base_newick.R Updated documentation to use lowercase "phylo2vec" terminology
r-phylo2vec/R/stats.R Enhanced documentation with output shape information and lowercase "phylo2vec" terminology
r-phylo2vec/R/utils.R Updated documentation to use lowercase "phylo2vec" terminology
r-phylo2vec/R/io.R Added documentation for check_path() and exported save_p2v()
r-phylo2vec/tests/testthat/*.R Updated test calls from to_newick_from_vector/matrix() to unified to_newick()
r-phylo2vec/man/*.Rd Removed documentation files for un-exported functions and updated existing files with improved descriptions
r-phylo2vec/NAMESPACE Removed exports for lower-level functions to streamline the public API
r-phylo2vec/README.md Updated example to use unified to_newick() function

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Neclow Neclow merged commit a7d65a8 into sbhattlab:main Oct 22, 2025
8 checks passed
@Neclow Neclow deleted the reorganize_r branch October 22, 2025 07:25
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.

2 participants