Skip to content

Commit 0f1e22f

Browse files
Update remaining strings to % format
1 parent 4782ace commit 0f1e22f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

causal_testing/data_collection/data_collector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ def filter_valid_data(self, data: pd.DataFrame, check_pos: bool = True) -> pd.Da
7373
size_diff = len(data) - len(satisfying_data)
7474
if size_diff > 0:
7575
logger.warning(
76-
"Discarded %d/%d values due to constraint violations.\n" % (size_diff, len(data)) +
77-
"For example %s" % unsat_core
76+
"Discarded %s/%s values due to constraint violations.\n"
77+
"For example%s" % (size_diff, len(data), unsat_core)
7878
)
7979
return satisfying_data
8080

causal_testing/specification/causal_dag.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ def adjustment_set_is_minimal(self, treatments: list[str], outcomes: list[str],
349349
proper_backdoor_graph, treatments, outcomes, smaller_adjustment_set
350350
):
351351
logger.info(
352-
f"Z={adjustment_set} is not minimal because Z'=Z\\{{'{variable}'}}="
353-
f"{smaller_adjustment_set} is also a valid adjustment set."
352+
"Z=%s is not minimal because Z'=Z\\{{'%s'}}="
353+
"%s is also a valid adjustment set." % (adjustment_set, variable, smaller_adjustment_set)
354354
)
355355
return False
356356

@@ -393,16 +393,16 @@ def constructive_backdoor_criterion(
393393

394394
if not set(covariates).issubset(set(self.graph.nodes).difference(descendents_of_proper_casual_paths)):
395395
logger.info(
396-
f"Failed Condition 1: Z={covariates} **is** a descendent of some variable on a proper causal "
397-
f"path between X={treatments} and Y={outcomes}."
396+
"Failed Condition 1: Z=%s **is** a descendent of some variable on a proper causal "
397+
"path between X=%s and Y=%s." % (covariates, treatments, outcomes)
398398
)
399399
return False
400400

401401
# Condition (2)
402402
if not nx.d_separated(proper_backdoor_graph.graph, set(treatments), set(outcomes), set(covariates)):
403403
logger.info(
404-
f"Failed Condition 2: Z={covariates} **does not** d-separate X={treatments} and Y={outcomes} in"
405-
f" the proper back-door graph relative to X and Y."
404+
"Failed Condition 2: Z=%s **does not** d-separate X=%s and Y=%s in"
405+
" the proper back-door graph relative to X and Y.", {covariates, treatments, outcomes}
406406
)
407407
return False
408408

0 commit comments

Comments
 (0)