Skip to content

Cleaning#90

Merged
Neclow merged 9 commits intosbhattlab:mainfrom
Neclow:cleaning
Jul 4, 2025
Merged

Cleaning#90
Neclow merged 9 commits intosbhattlab:mainfrom
Neclow:cleaning

Conversation

@Neclow
Copy link
Collaborator

@Neclow Neclow commented Jul 4, 2025

  • rust: add more docstrings with examples for common public functions
  • python: fix warnings from deepsource and linters

@Neclow Neclow marked this pull request as ready for review July 4, 2025 14:08
@Neclow Neclow requested a review from Copilot July 4, 2025 14:08

This comment was marked as outdated.

@Neclow Neclow requested a review from Copilot July 4, 2025 14:21
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 cleans up Python version utilities and test suites, replaces bare assert statements with proper exceptions, and enriches Rust modules with standardized doc comments and examples.

  • Refactored update_version.py imports and error handling for version bumping utilities.
  • Consolidated and updated Python tests to reduce duplication and satisfy linters.
  • Standardized Rust doc comments to use # Examples and added a CSC conversion method.

Reviewed Changes

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

Show a summary per file
File Description
resources/update_version.py Reordered imports, replaced asserts with ValueError, improved version‐tag handling
py-phylo2vec/tests/test_stats.py Removed dead commented assertion
py-phylo2vec/tests/test_reorder.py Adjusted imports to fix linter warnings
py-phylo2vec/tests/test_io.py Factored out common test logic, updated exception checks
phylo2vec/phylo2vec/utils/vector.py Replaced assert with ValueError in get_common_ancestor
phylo2vec/phylo2vec/stats/nodewise.py Removed redundant dtype casts in precision
phylo2vec/phylo2vec/opt/_gradme_losses.py Replaced assert with ValueError for matrix shape check
phylo2vec/phylo2vec/opt/_beagle_losses.py Minor formatting cleanup
phylo2vec/phylo2vec/opt/_base.py Added explicit mode validation and reordered imports
phylo2vec/phylo2vec/io/_validation.py Replaced assert with ValueError in check_path
phylo2vec/phylo2vec/init.py Removed unused sys import
phylo2vec/src/vector/ops.rs Standardized doc comment headings (# Examples)
phylo2vec/src/vector/graph.rs Standardized doc comment headings, added CSC doc example
phylo2vec/src/vector/convert.rs Standardized doc comment headings, added new conversion methods
phylo2vec/src/vector/base.rs Punctuation fixes in sample_vector docs
phylo2vec/src/tree_vec/mod.rs Added module‐level doc comment
phylo2vec/src/newick/*.rs Standardized doc comment headings across multiple functions
phylo2vec/src/matrix/*.rs Standardized doc comment headings and added matrix examples
Comments suppressed due to low confidence (2)

resources/update_version.py:78

  • The docstring says an empty string is returned on git failures, but the code returns the input version or "0". Update the docstring to accurately describe the actual return values.
    try:

py-phylo2vec/tests/test_stats.py:194

  • [nitpick] There's a leftover commented-out assertion. Removing dead code improves readability and avoids confusion.
            assert np.array_equal(func(inc).toarray(), d)

@Neclow Neclow merged commit 840c625 into sbhattlab:main Jul 4, 2025
7 checks passed
@Neclow Neclow deleted the cleaning branch July 4, 2025 14:34
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