Skip to content

input4mips_validation.validation.comment#

input4mips_validation.validation.comment #

Validation of the comment attribute

validate_comment(comment) #

Validate the comment value

Parameters:

Name Type Description Default
comment str

Tracking ID value to validate

required

Raises:

Type Description
TypeError

comment's value is not a string

Source code in src/input4mips_validation/validation/comment.py
def validate_comment(comment: str) -> None:
    """
    Validate the comment value

    Parameters
    ----------
    comment
        Tracking ID value to validate

    Raises
    ------
    TypeError
        `comment`'s value is not a string
    """
    if not isinstance(comment, str):
        msg = (  # type: ignore[unreachable]
            f"The `comment` attribute must be a string, received {comment=!r}."
        )
        raise TypeError(msg)