Skip to content

Commit bf5df60

Browse files
committed
Pylint
1 parent cefa853 commit bf5df60

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

causal_testing/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def main() -> None:
2929
effect_type=args.effect_type,
3030
estimate_type=args.estimate_type,
3131
estimator=args.estimator,
32+
skip=True,
3233
)
3334
logging.info("Causal test generation completed successfully")
3435
return

causal_testing/testing/metamorphic_relation.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,7 @@ def generate_metamorphic_relations(
204204

205205

206206
def generate_causal_tests(
207-
dag_path: str,
208-
output_path: str,
209-
ignore_cycles: bool = False,
210-
threads: int = 0,
211-
estimate_type: str = "coefficient",
212-
effect_type: str = "direct",
213-
estimator: str = "LinearRegressionEstimator",
207+
dag_path: str, output_path: str, ignore_cycles: bool = False, threads: int = 0, **json_stub_kargs
214208
):
215209
"""
216210
Generate and output causal tests for a given DAG.
@@ -222,7 +216,7 @@ def generate_causal_tests(
222216
be omitted from the test set.
223217
:param threads: The number of threads to use to generate tests in parallel. If unspecified, tests are generated in
224218
serial. This is tylically fine unless the number of tests to be generated is >10000.
225-
:param effect_type: The type of causal effect to consider (total or direct)
219+
:param json_stub_kargs: Kwargs to pass into `to_json_stub` (see docstring for details.)
226220
:param estimate_type: The estimate type to use when evaluating tests
227221
:param estimator: The name of the estimator class to use when evaluating the test
228222
"""
@@ -247,7 +241,7 @@ def generate_causal_tests(
247241
relations = generate_metamorphic_relations(causal_dag, nodes_to_test=dag_nodes_to_test, threads=threads)
248242

249243
tests = [
250-
relation.to_json_stub(skip=False, estimate_type=estimate_type, effect_type=effect_type, estimator=estimator)
244+
relation.to_json_stub(**json_stub_kargs)
251245
for relation in relations
252246
if len(list(causal_dag.graph.predecessors(relation.base_test_case.outcome_variable))) > 0
253247
]

tests/testing_tests/test_metamorphic_relations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def test_should_cause_logistic_json_stub(self):
120120
should_cause_mr = ShouldCause(BaseTestCase("X1", "Z"), adj_set)
121121
self.assertEqual(
122122
should_cause_mr.to_json_stub(
123-
effect_type="total", estimate_type="unit_odds_ratio", estimator="LogisticRegressionEstimator"
123+
effect_type="total", estimate_type="unit_odds_ratio", estimator="LogisticRegressionEstimator", skip=True
124124
),
125125
{
126126
"effect": "total",
@@ -263,7 +263,7 @@ def test_generate_causal_tests_ignore_cycles(self):
263263
tests = json.load(f)
264264
expected = list(
265265
map(
266-
lambda x: x.to_json_stub(skip=False),
266+
lambda x: x.to_json_stub(skip=True),
267267
filter(
268268
lambda relation: len(list(dcg.graph.predecessors(relation.base_test_case.outcome_variable)))
269269
> 0,
@@ -283,7 +283,7 @@ def test_generate_causal_tests(self):
283283
tests = json.load(f)
284284
expected = list(
285285
map(
286-
lambda x: x.to_json_stub(skip=False),
286+
lambda x: x.to_json_stub(skip=True),
287287
filter(
288288
lambda relation: len(list(dag.graph.predecessors(relation.base_test_case.outcome_variable)))
289289
> 0,

0 commit comments

Comments
 (0)