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

from .errors import InvalidCellValue

def valid_value(val):
    if re.search("^[0-9]+\.[0-9]{3}$", val):
        return float(val)
    raise InvalidCellValue(
        f"Invalid value '{val}'.\n"
        "Expected string representing a number with exactly three decimal "
        "places.")