From 65c9f923a5057c99c18f43e2c1f0284d8293d9a3 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 5 Jan 2024 07:35:04 +0300 Subject: Revert "QC: Check for only one decimal place." This reverts commit c213b0010c3ddc8d3215adab65bd489a9b884e30. After a larger discussion with Arthur, Rob and Pjotr present, it was verified that the strict checks are important. This reverts the commit that allowed for looser checks. --- quality_control/average.py | 6 +++--- quality_control/standard_error.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'quality_control') diff --git a/quality_control/average.py b/quality_control/average.py index 95b6c4a..ad732d0 100644 --- a/quality_control/average.py +++ b/quality_control/average.py @@ -9,8 +9,8 @@ def invalid_value(line_number: int, column_number: int, val: str) -> Union[ """Return an `InvalidValue` object if `val` is not a valid "averages" value.""" return cell_error( - r"^[0-9]+\.[0-9]{1,}$", val, line=line_number, + r"^([0-9]+\.[0-9]{3}|[0-9]+\.?0*)$", val, line=line_number, column=column_number, value=val, message=( f"Invalid value '{val}'. " - "Expected string representing a number with at least one decimal " - "place.")) + "Expected string representing a number with exactly three " + "decimal places.")) diff --git a/quality_control/standard_error.py b/quality_control/standard_error.py index a1646bc..90beb8a 100644 --- a/quality_control/standard_error.py +++ b/quality_control/standard_error.py @@ -13,8 +13,8 @@ def invalid_value( `None`. """ return cell_error( - r"^[0-9]+\.[0-9]{1,}$", val, line=line_number, + r"^([0-9]+\.[0-9]{6,}|[0-9]+\.?0*)$", val, line=line_number, column=column_number, value=val, message=( f"Invalid value '{val}'. " - "Expected string representing a number with at least one " - "decimal place.")) + "Expected string representing a number with at least six " + "decimal places.")) -- cgit v1.2.3