Skip to content

Commit 7cdf77c

Browse files
Copilotakhanf
andauthored
Improve get_acq_constraint sentinel value with a proper never-matching regex
Agent-Logs-Url: https://github.com/khanlab/SPIMprep/sessions/91f24ab5-f565-4a53-8e6f-33d6d4b26771 Co-authored-by: akhanf <11492701+akhanf@users.noreply.github.com>
1 parent a69e60f commit 7cdf77c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

workflow/rules/common.smk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,9 @@ def get_acq_constraint(input_type_str):
271271
explicit input_type column rather than fragile substring matching on acq."""
272272
acqs = samples[samples["input_type"] == input_type_str]["acq"].unique().tolist()
273273
if not acqs:
274-
return "NOMATCH_EMPTY"
274+
# Return a regex that matches nothing when no samples use this input_type;
275+
# this prevents the rule from matching any wildcard value.
276+
return "(?!x)x"
275277
return "|".join(re.escape(acq) for acq in acqs)
276278

277279

0 commit comments

Comments
 (0)