Closed MarkDana closed 7 months ago
causallearn/graph/Endpoint.py
__eq__
self.value == other.value
isinstance(other, Endpoint) and self.value == other.value
The issue: https://github.com/py-why/causal-learn/issues/149 and earlier pr https://github.com/py-why/causal-learn/pull/109. In some of our codes, the Endpoint comparison is in the form of get_end_point(...) == Endpoint.ARROW, while the first function may return None, instead of any Endpoint instances. This patch fixed this issue.
get_end_point(...) == Endpoint.ARROW
TestFCI can now pass, and the issues mentioned in https://github.com/py-why/causal-learn/issues/149 are addressed.
TestFCI
Updated files:
causallearn/graph/Endpoint.py
: in the reloaded__eq__
, replaceself.value == other.value
byisinstance(other, Endpoint) and self.value == other.value
.Related to:
The issue: https://github.com/py-why/causal-learn/issues/149 and earlier pr https://github.com/py-why/causal-learn/pull/109. In some of our codes, the Endpoint comparison is in the form of
get_end_point(...) == Endpoint.ARROW
, while the first function may return None, instead of any Endpoint instances. This patch fixed this issue.Tests:
TestFCI
can now pass, and the issues mentioned in https://github.com/py-why/causal-learn/issues/149 are addressed.