Skip to content

Commit 4bb55d9

Browse files
committed
Fixes to PR #244
1 parent d18fc4d commit 4bb55d9

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

examples/covasim_/vaccinating_elderly/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ four test cases: one focusing on each of the four previously mentioned outputs.
1313

1414
Further details are provided in Section 5.3 (Prioritising the elderly for vaccination) of the paper.
1515

16-
Note: this version of the example utilises the observational data collector, which was previously simulated using the
17-
experimental data collector, in order to save computation time.
16+
**Note**: this version of the CTF utilises the observational data collector in order to separate the software execution
17+
and testing. Older versions of this framework simulate the data using the custom experimental data collector and the
18+
`covasim` package (version 3.0.7) as outlined below.
1819

1920
## How to run
2021
To run this case study:

examples/covasim_/vaccinating_elderly/example_vaccine.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# -*- coding: utf-8 -*-
22
import os
33
import logging
4-
import warnings
54
import pandas as pd
65
from causal_testing.specification.causal_dag import CausalDAG
76
from causal_testing.specification.scenario import Scenario
@@ -13,7 +12,6 @@
1312
from causal_testing.testing.estimators import LinearRegressionEstimator
1413
from causal_testing.testing.base_test_case import BaseTestCase
1514

16-
warnings.filterwarnings("ignore", message=".*The 'nopython' keyword.*") # Supress the numba warning in covasim
1715

1816
logger = logging.getLogger(__name__)
1917
logging.basicConfig(level=logging.DEBUG, format="%(message)s")
@@ -28,7 +26,7 @@ def setup_test_case(verbose: bool = False):
2826
:return results_dict: A dictionary containing ATE, 95% CIs, and Test Pass/Fail
2927
"""
3028

31-
# 1. Create causal dag
29+
# 1. Read in the Causal DAG
3230
causal_dag = CausalDAG(f"{ROOT}/dag.dot")
3331

3432
# 2. Create variables
@@ -81,6 +79,7 @@ def setup_test_case(verbose: bool = False):
8179
# 7. Obtain the minimal adjustment set for the causal test case from the causal DAG
8280
minimal_adjustment_set = causal_dag.identification(base_test_case)
8381

82+
# 8. Build statistical model using the Linear Regression estimator
8483
linear_regression_estimator = LinearRegressionEstimator(
8584
treatment=vaccine.name,
8685
treatment_value=1,
@@ -90,6 +89,7 @@ def setup_test_case(verbose: bool = False):
9089
df=obs_df,
9190
)
9291

92+
# 9. Execute test and save results in dict
9393
causal_test_result = causal_test_case.execute_test(linear_regression_estimator, data_collector)
9494

9595
if verbose:
@@ -107,6 +107,7 @@ def setup_test_case(verbose: bool = False):
107107

108108

109109
if __name__ == "__main__":
110+
110111
test_results = setup_test_case(verbose=True)
111112

112113
logging.info("%s", test_results)

0 commit comments

Comments
 (0)