Skip to content
Snippets Groups Projects
Commit 22f1d63b authored by Danilo Ferreira de Lima's avatar Danilo Ferreira de Lima
Browse files

Check class type in equality check.

parent 9fcbf22b
No related branches found
No related tags found
1 merge request!26Added example for SCS.
Pipeline #132016 passed
......@@ -106,10 +106,12 @@ class VSConfig(object):
diff.gas = set(self.gas).difference(set(other.gas))
return diff
def __eq__(self, other: 'VSConfig') -> bool:
def __eq__(self, other: object) -> bool:
"""
Check if two configurations match.
"""
if not isinstance(other, VSConfig):
raise ValueError("I can only check equality with another VSConfig object.")
diff = self - other
for k, v in diff.voltage.items():
if np.fabs(v) > 0.1:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment