Skip to content

Removed deubugging print satement from NoEffect class #355

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

Merged
merged 3 commits into from
Aug 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions causal_testing/testing/causal_effect.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __init__(self, atol: float = 1e-10, ctol: float = 0.05):
self.ctol = ctol

def apply(self, res: CausalTestResult) -> bool:
if res.effect_estimate.type in ("risk_ratio", "hazard_ratio", "unit_odds_ratio"):
if res.effect_estimate.type in ("risk_ratio", "hazard_ratio", "unit_odds_ratio", "odds_ratio"):
return any(
ci_low < 1 < ci_high or np.isclose(value, 1.0, atol=self.atol)
for ci_low, ci_high, value in zip(
Expand All @@ -69,8 +69,6 @@ def apply(self, res: CausalTestResult) -> bool:
if isinstance(res.effect_estimate.ci_high, Iterable)
else [res.effect_estimate.value]
)
for ci_low, ci_high, v in zip(res.effect_estimate.ci_low, res.effect_estimate.ci_high, value):
print(not ((ci_low < 0 < ci_high) or abs(v) < self.atol))
return (
sum(
not ((ci_low < 0 < ci_high) or abs(v) < self.atol)
Expand Down
8 changes: 5 additions & 3 deletions causal_testing/testing/metamorphic_relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,11 @@ def generate_causal_tests(
if len(list(causal_dag.predecessors(relation.base_test_case.outcome_variable))) > 0
]

logger.warning("The skip parameter is hard-coded to False during test generation for better integration with the "
"causal testing component (python -m causal_testing test ...)"
"Please carefully review the generated tests and decide which to skip.")
logger.warning(
"The skip parameter is hard-coded to False during test generation for better integration with the "
"causal testing component (python -m causal_testing test ...)"
"Please carefully review the generated tests and decide which to skip."
)

logger.info(f"Generated {len(tests)} tests. Saving to {output_path}.")
with open(output_path, "w", encoding="utf-8") as f:
Expand Down
Loading