Skip to content

Commit

Permalink
Merge pull request #232 from CITCOM-project/test-adequacy
Browse files Browse the repository at this point in the history
Fixed serialisation bug
  • Loading branch information
jmafoster1 authored Aug 15, 2023
2 parents 13a44fc + b1b30be commit ee8be4d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions causal_testing/testing/causal_test_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ def to_dict(self, json=False):
"outcome": self.estimator.outcome,
"adjustment_set": list(self.adjustment_set) if json else self.adjustment_set,
"effect_measure": self.test_value.type,
"effect_estimate": self.test_value.value,
"ci_low": self.ci_low(),
"ci_high": self.ci_high(),
"effect_estimate": self.test_value.value.to_dict()
if json and hasattr(self.test_value.value, "to_dict")
else self.test_value.value,
"ci_low": self.ci_low().to_dict() if json and hasattr(self.ci_low(), "to_dict") else self.ci_low(),
"ci_high": self.ci_high().to_dict() if json and hasattr(self.ci_high(), "to_dict") else self.ci_high(),
}
if self.adequacy:
base_dict["adequacy"] = self.adequacy.to_dict()
Expand Down

0 comments on commit ee8be4d

Please sign in to comment.