From 0cc8fd5fb2a026662dc2bd12f6bad9f68e5da5b0 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 13 Apr 2022 10:01:57 +0300 Subject: Update Exception name Change the exception name to be more descriptive. --- quality_control/average.py | 4 ++-- quality_control/errors.py | 2 +- quality_control/standard_error.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'quality_control') diff --git a/quality_control/average.py b/quality_control/average.py index 1a7bf5f..c552ba3 100644 --- a/quality_control/average.py +++ b/quality_control/average.py @@ -1,12 +1,12 @@ """Contain logic for checking average files""" import re -from .errors import InvalidValue +from .errors import InvalidCellValue def valid_value(val): if re.search("^[0-9]+\.[0-9]{3}$", val): return float(val) - raise InvalidValue( + raise InvalidCellValue( f"Invalid value '{val}'.\n" "Expected string representing a number with exactly three decimal " "places.") diff --git a/quality_control/errors.py b/quality_control/errors.py index a77039b..99f9c97 100644 --- a/quality_control/errors.py +++ b/quality_control/errors.py @@ -1,6 +1,6 @@ """Hold exceptions for QC package""" -class InvalidValue(Exception): +class InvalidCellValue(Exception): """Raised when a function encounters an invalid value""" def __init__(self, *args): diff --git a/quality_control/standard_error.py b/quality_control/standard_error.py index ae1e378..7b49913 100644 --- a/quality_control/standard_error.py +++ b/quality_control/standard_error.py @@ -1,12 +1,12 @@ """Contain logic for checking standard error files""" import re -from .errors import InvalidValue +from .errors import InvalidCellValue def valid_value(val): if re.search("^[0-9]+\.[0-9]{6,}$", val): return float(val) - raise InvalidValue( + raise InvalidCellValue( f"Invalid value '{val}'.\n" "Expected string representing a number with at least six decimal " "places.") -- cgit v1.2.3