Skip to content

Conversation

@hzhangxyz
Copy link
Member

No description provided.

@hzhangxyz hzhangxyz force-pushed the dev/add-support-to-dtype-to branch from 3e97afa to cc44007 Compare July 31, 2025 03:55
@hzhangxyz hzhangxyz requested a review from Copilot July 31, 2025 03:55

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Jul 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.57%. Comparing base (f6fb29e) to head (9508f04).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
+ Coverage   28.81%   38.57%   +9.76%     
==========================================
  Files           3        3              
  Lines         177      197      +20     
  Branches       19       26       +7     
==========================================
+ Hits           51       76      +25     
+ Misses        126      121       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hzhangxyz hzhangxyz force-pushed the dev/add-support-to-dtype-to branch 2 times, most recently from f716d8a to fb4141e Compare July 31, 2025 04:03
@hzhangxyz hzhangxyz requested a review from Copilot July 31, 2025 04:04

This comment was marked as outdated.

@hzhangxyz hzhangxyz force-pushed the dev/add-support-to-dtype-to branch from fb4141e to bc1d886 Compare July 31, 2025 05:41
@hzhangxyz hzhangxyz requested a review from Copilot July 31, 2025 05:43

This comment was marked as outdated.

@hzhangxyz hzhangxyz force-pushed the dev/add-support-to-dtype-to branch from bc1d886 to f62c660 Compare July 31, 2025 05:47
@hzhangxyz hzhangxyz force-pushed the dev/add-support-to-dtype-to branch from f62c660 to 9508f04 Compare July 31, 2025 05:51
@hzhangxyz hzhangxyz requested a review from Copilot July 31, 2025 05:52
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 enhances the to method of the ParityTensor class to support more flexible conversion options, including device and dtype conversions with multiple parameter formats. The method now accepts positional arguments for device/dtype specifications alongside keyword arguments.

  • Expands the to method signature to accept torch.device, torch.dtype, or string parameters
  • Adds comprehensive test coverage for various parameter combinations and error cases
  • Implements validation to prevent duplicate parameter specifications

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
parity_tensor/parity_tensor.py Enhanced to method with flexible parameter handling and dtype conversion support
tests/conversion_test.py Added comprehensive test suite covering parameter combinations and edge cases
Comments suppressed due to low confidence (2)

tests/conversion_test.py:41

  • The condition len(args) <= 1 means cases with 2 positional arguments (device + dtype) are never tested, leaving important functionality uncovered.
    if len(args) <= 1:

parity_tensor/parity_tensor.py:67

  • The parameter name whatever is unclear and unprofessional. Consider renaming it to something more descriptive like target or destination.
    def to(self, whatever: torch.device | torch.dtype | str | None = None, *, device: torch.device | None = None, dtype: torch.dtype | None = None) -> ParityTensor:

@hzhangxyz hzhangxyz merged commit 90dfc55 into main Jul 31, 2025
10 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