Skip to content

Conversation

@hzhangxyz
Copy link
Member

No description provided.

@hzhangxyz hzhangxyz requested a review from Copilot July 31, 2025 01: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 simplifies the code by replacing manual ParityTensor constructor calls with dataclasses.replace(). This change reduces code duplication and makes the intent clearer when creating new instances with only specific fields modified.

  • Replaces verbose ParityTensor constructor calls with more concise dataclasses.replace() calls
  • Eliminates redundant field assignments by leveraging the default copying behavior of dataclasses.replace()
  • Maintains the same functionality while improving code readability and maintainability

"""
return ParityTensor(
_edges=self._edges,
return dataclasses.replace(
Copy link

Copilot AI Jul 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dataclasses module is not imported. You need to add import dataclasses at the top of the file to use dataclasses.replace().

Copilot uses AI. Check for mistakes.
@hzhangxyz hzhangxyz merged commit a0ad401 into main Jul 31, 2025
6 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