Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have more coherent testing of the summary method #305

Open
drbenvincent opened this issue Mar 5, 2024 · 0 comments
Open

Have more coherent testing of the summary method #305

drbenvincent opened this issue Mar 5, 2024 · 0 comments
Labels
devops DevOps related good first issue Good for newcomers

Comments

@drbenvincent
Copy link
Collaborator

At the moment it seems that we only test the summary method for the pymc_experiments.DifferenceInDifferences class, and that is in the test_pymc_experiments.py file...

def test_did_summary():
"""Test that the summary stat function returns a string."""
df = cp.load_data("did")
result = cp.pymc_experiments.DifferenceInDifferences(
df,
formula="y ~ 1 + group*post_treatment",
time_variable_name="t",
group_variable_name="group",
model=cp.pymc_models.LinearRegression(sample_kwargs=sample_kwargs),
)
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)

We should make sure that we are testing the summary method for all of the pymc_experiment classes. Though I believe the InstrumentalVariable class doesn't have a summery method.

This could be done by adding more to the current test_pymc_experiments.py file, but it could be worth thinking about simply adding to existing tests in test_integration_pymc_examples.py. My thinking is that this would involve less setup / computation time as we wouldn't be doing any additional model fitting.

@drbenvincent drbenvincent added good first issue Good for newcomers devops DevOps related labels Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops DevOps related good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant