def METHOD_NAME(self, Z):
    """Check that func and inverse_func are each other's inverse."""
    Z_round_trip = self.inverse_func(self.func(Z))
    if not np.allclose(Z_round_trip, Z, equal_nan=True):
        raise UserWarning(
            "The provided functions are not strictly"
            " inverse of each other. If you are sure you"
            " want to proceed regardless, set"
            " 'check_inverse=False'."
        )