def constr_to_cv(
        c: Union[np.ndarray,None], 
        eps: float = 0.0, 
        scale: Optional[float] = None, 
        pow: Optional[float] = None, 
        func: object = np.mean,
    ) -> float:
    """
    Convert a constraint to a constraint violation.

    c : np.ndarray
        An array of constraint violations.
    eps : float
        Error tolerance bounds.
    scale : float, None
        The scale to apply to a constraint violation.
        If ``None``, no scale alteration is applied.
    pow : float, None
        A power to apply to a constraint violation.
        If ``None``, no power alteration is applied.
    func : function
        A function to convert multiple constraint violations into a single score.
    """
    if c is None or len(c) == 0:
        return 0.0

    # subtract eps to allow some violation and then zero out all values less than zero
    c = np.maximum(0.0, c - eps)

    # apply init_simplex_scale if necessary
    if scale is not None:
        c = c / scale

    # if a pow factor has been provided
    if pow is not None:
        c = c ** pow

    return func(c)

    Convert a constraint to a constraint violation.

    c : np.ndarray
        An array of constraint violations.
    eps : float
        Error tolerance bounds.
    scale : float, None
        The scale to apply to a constraint violation.
        If ``None``, no scale alteration is applied.
    pow : float, None
        A power to apply to a constraint violation.
        If ``None``, no power alteration is applied.
    func : function
        A function to convert multiple constraint violations into a single score.
    
pymoo/core/individual.py