From 903af1c0b1f2cc695ea4e0c31438f9205571d15d Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 27 Apr 2022 17:37:22 +0300 Subject: Implement command-line interface for QC of files --- quality_control/average.py | 2 +- quality_control/parsing.py | 3 +-- quality_control/standard_error.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'quality_control') diff --git a/quality_control/average.py b/quality_control/average.py index 3261e1c..2907b9c 100644 --- a/quality_control/average.py +++ b/quality_control/average.py @@ -8,6 +8,6 @@ def valid_value(val): if re.search(r"^[0-9]+\.[0-9]{3}$", val): return float(val) raise InvalidCellValue( - f"Invalid value '{val}'.\n" + f"Invalid value '{val}'. " "Expected string representing a number with exactly three decimal " "places.") diff --git a/quality_control/parsing.py b/quality_control/parsing.py index a4edb0f..9fe88f1 100644 --- a/quality_control/parsing.py +++ b/quality_control/parsing.py @@ -62,7 +62,7 @@ def parse_file(filepath: str, filetype: FileType, strains: list): with open(filepath, encoding="utf-8") as input_file: for line_number, line in enumerate(input_file): if line_number == 0: - yield __parse_header(line, strains) + yield __parse_header(line, strains), seek_pos + len(line) seek_pos = seek_pos + len(line) continue @@ -83,7 +83,6 @@ def parse_file(filepath: str, filetype: FileType, strains: list): def parse_errors(filepath: str, filetype: FileType, strains: list, seek_pos: int = 0) -> Generator: """Retrieve ALL the parse errors""" - print(f"seek_pos: {seek_pos}, {type(seek_pos)}") assert seek_pos >= 0, "The seek position must be at least zero (0)" def __error_type(error): diff --git a/quality_control/standard_error.py b/quality_control/standard_error.py index 805c30e..f1e33c4 100644 --- a/quality_control/standard_error.py +++ b/quality_control/standard_error.py @@ -8,6 +8,6 @@ def valid_value(val): if re.search(r"^[0-9]+\.[0-9]{6,}$", val): return float(val) raise InvalidCellValue( - f"Invalid value '{val}'.\n" + f"Invalid value '{val}'. " "Expected string representing a number with at least six decimal " "places.") -- cgit v1.2.3