Skip to content

Commit

Permalink
improve __eq__
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomomagni committed Nov 7, 2024
1 parent 15f4a78 commit 193c0c6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/yadism/coefficient_functions/coupling_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,10 +480,8 @@ def __repr__(self):
return "CKM(" + str(self.m).replace("\n", "") + ")"

def __eq__(self, other) -> bool:
eq = True
for a, b in zip(self.__dict__, other.__dict__):
eq = a == b
return eq
"""Equal method."""
return (self.m == other.m).all()

def __getitem__(self, key):
"""Allow pid and strings as key.
Expand Down

0 comments on commit 193c0c6

Please sign in to comment.