aboutsummaryrefslogtreecommitdiff
path: root/quality_control/standard_error.py
blob: f1e33c4f3745e008a1e582c12c37cb0a1c52bf53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
"""Contain logic for checking standard error files"""
import re

from .errors import InvalidCellValue

def valid_value(val):
    """Checks whether `val` is a valid value for standard errors"""
    if re.search(r"^[0-9]+\.[0-9]{6,}$", val):
        return float(val)
    raise InvalidCellValue(
        f"Invalid value '{val}'. "
        "Expected string representing a number with at least six decimal "
        "places.")