diff --git a/openff/bespokefit/executor/services/models.py b/openff/bespokefit/executor/services/models.py index 43ce32a9..9f6ee205 100644 --- a/openff/bespokefit/executor/services/models.py +++ b/openff/bespokefit/executor/services/models.py @@ -30,7 +30,7 @@ def __gt__(self, other): def __eq__(self, other): return ( - type(self) == type(other) + type(self) is type(other) and self.id.__eq__(other.id) and self.self.__eq__(other.self) ) diff --git a/openff/bespokefit/schema/smirnoff.py b/openff/bespokefit/schema/smirnoff.py index c3dbf1e3..b53deea8 100644 --- a/openff/bespokefit/schema/smirnoff.py +++ b/openff/bespokefit/schema/smirnoff.py @@ -70,7 +70,7 @@ def from_smirnoff(cls, parameter: ParameterType): """Creates a version of this class from a SMIRNOFF parameter""" def __eq__(self, other): - return type(self) == type(other) and self.__hash__() == other.__hash__() + return type(self) is type(other) and self.__hash__() == other.__hash__() def __ne__(self, other): assert not self.__eq__(other) diff --git a/openff/bespokefit/tests/optimizers/forcebalance/test_factories.py b/openff/bespokefit/tests/optimizers/forcebalance/test_factories.py index c1299e25..76b697dd 100644 --- a/openff/bespokefit/tests/optimizers/forcebalance/test_factories.py +++ b/openff/bespokefit/tests/optimizers/forcebalance/test_factories.py @@ -69,7 +69,7 @@ def test_local_to_qc_records(result_fixture, request): LocalQCData(qc_records=[qc_result]) ) - assert type(qc_record) == type(qc_result) + assert type(qc_record) is type(qc_result) assert molecule.to_smiles() == expected_molecule.to_smiles() assert molecule.n_conformers == expected_molecule.n_conformers