def add_unary_magic_methods(np_funcs, translate_func):
    """Class decorator to add unary magic methods using NumPy to the class."""

    def wrapper(cls):
        for fname, np_func in np_funcs:
            def magic_func(self, np_func=np_func):
                return translate_func(self, np_func)

            setattr(cls, fname, magic_func)
        return cls

    return wrapper