Skip to content

Commit e4a8cdd

Browse files
authored
Merge pull request #96 from uab-cgds-worthey/testing-detect-fix
adding testing detection function fix
2 parents 2a01bad + d685e0e commit e4a8cdd

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

docs/Changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ YYYY-MM-DD John Doe
1212
```
1313
---
1414

15+
2024-07-08 Brandon Wilk
16+
17+
* Makes minor bug fix for issue #95 found in the test run detection logging function
18+
1519
2023-10-09 Manavalan Gajapathy
1620

1721
- Makes minor documentation updates - updating citation info, adding JOSS badge and updating zenodo badge to use generic

workflow/rules/common.smk

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,23 @@ def is_testing_mode():
4040
"checks if testing dataset is used as input for the pipeline"
4141

4242
query = ".test"
43+
isTesting = False
4344
for sample in SAMPLES_CONFIG.values():
44-
for fpath in sample.values():
45-
if query in PurePath(fpath).parts:
46-
logger.info(f"// WARNING: '{query}' present in at least one of the filepaths supplied via --sample_config. So testing mode is used.")
47-
return True
45+
for fvalue in sample.values():
46+
if isinstance(fvalue, str) and query in PurePath(fvalue).parts:
47+
isTesting = True
48+
else:
49+
for fpath in fvalue:
50+
if query in PurePath(fpath).parts:
51+
isTesting = True
52+
53+
if isTesting:
54+
logger.info(f"// WARNING: '{query}' present in at least one of the filepaths supplied via --sample_config. So testing mode is used.")
55+
return True
4856

4957
return None
5058

5159

52-
5360
def get_priorQC_filepaths(sample, samples_dict):
5461
"""
5562
Returns filepaths relevant to priorQC

0 commit comments

Comments
 (0)