From aeaeeae277173e4901112efac15a967c73655585 Mon Sep 17 00:00:00 2001 From: Gesina Phillips Date: Thu, 24 Oct 2024 16:54:35 -0400 Subject: [PATCH] oops forgot to revert thread_count thing --- src/ingest_validation_tests/fastq_validator.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/ingest_validation_tests/fastq_validator.py b/src/ingest_validation_tests/fastq_validator.py index 1178e83..072c1d6 100644 --- a/src/ingest_validation_tests/fastq_validator.py +++ b/src/ingest_validation_tests/fastq_validator.py @@ -1,3 +1,4 @@ +from os import cpu_count from typing import List, Optional from fastq_validator_logic import FASTQValidatorLogic, _log @@ -8,14 +9,10 @@ class FASTQValidator(Validator): description = "Check FASTQ files for basic syntax and consistency." cost = 15.0 version = "1.0" - # need to add to parent validator class in IVT, hack for now - thread_count = None def collect_errors(self, **kwargs) -> List[Optional[str]]: - del kwargs - if not self.thread_count: - self.thread_count = 1 - _log(f"Threading at FastQValidator with {self.thread_count}") + threads = kwargs.get("coreuse", None) or cpu_count() // 4 or 1 + _log(f"Threading at FastQValidator with {threads}") validator = FASTQValidatorLogic(verbose=True) validator.validate_fastq_files_in_path(self.paths, self.thread_count) if validator.errors: