You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If it helps, I've been using the code below to check for fact equality:
def fact_compare(first:AbstractFact, second:AbstractFact):
if type(first) != type(second):
return False
if first.value != second.value:
return False
if first.xml_id != second.xml_id:
return False
if first.footnote != second.footnote:
return False
if isinstance(first, NumericFact):
first:NumericFact = first
second:NumericFact = second
if first.decimals != second.decimals:
return False
if first.unit != second.unit:
return False
else:
first:TextFact = first
second:TextFact = second
if not context_compare(first.context, second.context):
return False
if not concept_compare(first.concept, second.concept):
return False
return True
Add an eq() method to all fact classes to test for equality
The text was updated successfully, but these errors were encountered: