From 347ca2fe50225b4736e69bb86d8b278818be40ac Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 18 May 2022 17:34:55 +0300 Subject: Remove obsoleted code. Fix linting errors. Remove the old code that relied on exceptions to parse errors in the uploaded files. --- quality_control/average.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'quality_control/average.py') diff --git a/quality_control/average.py b/quality_control/average.py index 9ca16a9..47a04d9 100644 --- a/quality_control/average.py +++ b/quality_control/average.py @@ -3,19 +3,11 @@ import re from typing import Union from .errors import InvalidValue -from .errors import InvalidCellValue - -def valid_value(val): - """Checks whether `val` is a valid value for averages""" - if re.search(r"^[0-9]+\.[0-9]{3}$", val): - return float(val) - raise InvalidCellValue( - f"Invalid value '{val}'. " - "Expected string representing a number with exactly three decimal " - "places.") def invalid_value(line_number: int, column_number: int, val: str) -> Union[ InvalidValue, None]: + """Return an `InvalidValue` object if `val` is not a valid "averages" + value.""" if re.search(r"^[0-9]+\.[0-9]{3}$", val): return None return InvalidValue( -- cgit v1.2.3