@classmethod
def join_name(cls, source, direction):
    """
        Joins a shift *source* and a shift *direction* to return a shift name. If either *source* or
        *direction* is *None*, *None* is returned. If *source* is *NOMINAL*, *direction* must be
        *NOMINAL* as well. Otherwise, *direction* must be either *UP* or *DOWN*. Example:

        .. code-block:: python

            join_name("nominal", "nominal")  # -> "nominal"
            join_name("nominal", "up")       # -> ValueError: pointless nominal shift direction
            join_name("pdf", "up")           # -> "pdf_up"
            join_name("pdf", "high")         # -> ValueError: invalid shift direction
        """
    if source == cls.NOMINAL:
        if direction != cls.NOMINAL:
            raise ValueError('pointless nominal shift direction: {}'.format
                (direction))
        else:
            return cls.NOMINAL
    elif direction in (cls.UP, cls.DOWN):
        return '{}_{}'.format(source, direction)
    else:
        raise ValueError('unknown shift direction: {}'.format(direction))
