import functools


def check_pbc_and_unwrap(function):
    """Decorator to raise ValueError when both 'pbc' and 'unwrap' are set to True.
    """
    @functools.wraps(function)
    def wrapped(group, *args, **kwargs):
        if kwargs.get('compound') == 'group':
            if kwargs.get('pbc') and kwargs.get('unwrap'):
                raise ValueError(
                    "both 'pbc' and 'unwrap' can not be set to true")
        return function(group, *args, **kwargs)
    return wrapped