Skip to content

Commit

Permalink
Merge pull request #302 from anevolbap/issue_299-summary-did
Browse files Browse the repository at this point in the history
Fix #299: Rounding issue for DiD results.
  • Loading branch information
drbenvincent committed Mar 5, 2024
2 parents 6043b9e + 42018ca commit 3bb81a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion causalpy/pymc_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ def summary(self, round_to=None) -> None:
print(f"{self.expt_type:=^80}")
print(f"Formula: {self.formula}")
print("\nResults:")
print(round_num(self._causal_impact_summary_stat(), round_to))
print(self._causal_impact_summary_stat(round_to))
self.print_coefficients(round_to)


Expand Down
6 changes: 4 additions & 2 deletions causalpy/tests/test_pymc_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ def test_did_summary():
group_variable_name="group",
model=cp.pymc_models.LinearRegression(sample_kwargs=sample_kwargs),
)
print(type(result._causal_impact_summary_stat()))
assert isinstance(result._causal_impact_summary_stat(), str)
round_to = None
print(type(result._causal_impact_summary_stat(round_to)))
print(result._causal_impact_summary_stat(round_to))
assert isinstance(result._causal_impact_summary_stat(round_to), str)


def test_regression_kink_gradient_change():
Expand Down

0 comments on commit 3bb81a7

Please sign in to comment.