aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-05-27 12:28:12 +0300
committerFrederick Muriuki Muriithi2022-05-27 12:28:12 +0300
commit1555492cbd446cb942b435075e3c82aa1c61dca4 (patch)
tree8ac6c37eb91cf7083043750f86bfa9af0431d6a0
parentc3ff4b25ebf190712dbe911a79a87bd5eb55e7c2 (diff)
downloadgn-uploader-1555492cbd446cb942b435075e3c82aa1c61dca4.tar.gz
Accept zeroes
-rw-r--r--quality_control/average.py2
-rw-r--r--quality_control/standard_error.py2
2 files changed, 4 insertions, 0 deletions
diff --git a/quality_control/average.py b/quality_control/average.py
index 47a04d9..fd0cf4e 100644
--- a/quality_control/average.py
+++ b/quality_control/average.py
@@ -10,6 +10,8 @@ def invalid_value(line_number: int, column_number: int, val: str) -> Union[
value."""
if re.search(r"^[0-9]+\.[0-9]{3}$", val):
return None
+ if re.search(r"^0\.0+$", val) or re.search("^0+$"):
+ return None
return InvalidValue(
line_number, column_number, val, (
f"Invalid value '{val}'. "
diff --git a/quality_control/standard_error.py b/quality_control/standard_error.py
index c866993..aa7df3c 100644
--- a/quality_control/standard_error.py
+++ b/quality_control/standard_error.py
@@ -14,6 +14,8 @@ def invalid_value(
"""
if re.search(r"^[0-9]+\.[0-9]{6,}$", val):
return None
+ if re.search(r"^0\.0+$", val) or re.search("^0+$", val):
+ return None
return InvalidValue(
line_number, column_number, val, (
f"Invalid value '{val}'. "