Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement __eq__ for Atoms. #412

Merged
merged 1 commit into from
Dec 11, 2024
Merged

Implement __eq__ for Atoms. #412

merged 1 commit into from
Dec 11, 2024

Conversation

ffl096
Copy link
Member

@ffl096 ffl096 commented Dec 11, 2024

Two atoms are considered equal if they have the same elements. User-defined attributes may differ for equal atoms.

@ffl096 ffl096 added the enhancement New feature or request label Dec 11, 2024
@ffl096 ffl096 self-assigned this Dec 11, 2024
@ffl096 ffl096 requested a review from Copilot December 11, 2024 14:53

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no suggestions.

Comments skipped due to low confidence (2)

toponetx/classes/complex.py:60

  • The comparison self.elements == other.elements assumes that 'elements' is always defined and comparable. Ensure 'elements' exists and is of a comparable type in both objects.
return type(self) is type(other) and self.elements == other.elements

toponetx/classes/path_complex.py:159

  • The change from set(tmp_paths) to tmp_paths might introduce duplicate paths being added, as set ensures uniqueness while a list does not.
self.add_paths_from(tmp_paths)
Two atoms are considered equal if they have the same elements.
User-defined attributes may differ for equal atoms.
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.78%. Comparing base (62ada0a) to head (9115b02).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #412   +/-   ##
=======================================
  Coverage   97.77%   97.78%           
=======================================
  Files          38       38           
  Lines        3557     3559    +2     
=======================================
+ Hits         3478     3480    +2     
  Misses         79       79           

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

@ffl096 ffl096 merged commit 60ddcc7 into main Dec 11, 2024
19 checks passed
@ffl096 ffl096 deleted the frantzen/atom-eq branch December 11, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant