Skip to content

Upgrade Python development and use new PyO3 syntax - #134

Merged
cauliyang merged 3 commits into
mainfrom
dev-upgrade
May 21, 2026
Merged

Upgrade Python development and use new PyO3 syntax#134
cauliyang merged 3 commits into
mainfrom
dev-upgrade

Conversation

@cauliyang

Copy link
Copy Markdown
Contributor

This pull request primarily updates dependencies and improves Python interoperability for several Rust structs by adding the from_py_object attribute to their #[pyclass] macros. It also includes a minor test code simplification.

Dependency updates:

  • Updated numpy to version 0.28.0 and pyo3 to 0.28.3 in Cargo.toml, improving compatibility and access to new features.
  • Updated parquet and arrow crates to version 58.3 in Cargo.toml.

Python interoperability improvements:

  • Added from_py_object to #[pyclass] for the following structs, allowing construction from Python objects:
    • JsonEncoder in src/fq_encode/json_encoder.rs
    • FqEncoderOption in src/fq_encode/option.rs
    • ParquetEncoder in src/fq_encode/parquet_encoder.rs
    • TensorEncoder in src/fq_encode/tensor_encoder.rs
    • PslAlignment in src/smooth/blat.rs
    • StatResult in src/smooth/stat.rs

Test code simplification:

  • Simplified the streaming FASTQ reader test to use a for loop instead of manual iteration in src/output/writefq.rs.

Copilot AI review requested due to automatic review settings May 21, 2026 15:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates core Rust/Python interoperability dependencies and adapts several exposed Rust #[pyclass] types to the newer PyO3 extraction syntax, while also doing a small test iteration cleanup.

Changes:

  • Bumped Rust dependencies: numpy0.28.0, pyo30.28.3, and arrow/parquet58.3.
  • Added from_py_object to multiple #[pyclass(...)] declarations to support construction/extraction from Python objects with the new PyO3 syntax.
  • Simplified a FASTQ streaming reader test loop to use for iteration.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Cargo.toml Updates Rust crate versions for PyO3/numpy and arrow/parquet.
src/fq_encode/json_encoder.rs Adds #[pyclass(from_py_object)] for PyO3 extraction compatibility.
src/fq_encode/option.rs Adds #[pyclass(from_py_object)] for PyO3 extraction compatibility.
src/fq_encode/parquet_encoder.rs Adds #[pyclass(from_py_object)] for PyO3 extraction compatibility.
src/fq_encode/tensor_encoder.rs Adds #[pyclass(from_py_object)] for PyO3 extraction compatibility.
src/output/writefq.rs Refactors streaming-reader test to a for loop iteration style.
src/smooth/blat.rs Adds #[pyclass(from_py_object)] for PyO3 extraction compatibility.
src/smooth/stat.rs Adds #[pyclass(from_py_object)] for PyO3 extraction compatibility.
deepchopper/cli.py Removes an extra blank line (no functional change).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cauliyang
cauliyang merged commit ec21958 into main May 21, 2026
33 checks passed
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