def _check_inventory(f):
    """
    Decorator for `EODataCube` functions to check if the inventory exists.

    Parameters
    ----------
    f : function
        'EODataCube' function that has a keyword argument `inplace`

    Returns
    -------
    function
        Wrapper around `f`.
    """

    def f_wrapper(self, *args, **kwargs):
        inplace = kwargs.get('inplace')
        if self.inventory is not None:
            return f(self, *args, **kwargs)
        else:
            if inplace:
                return None
            else:
                return self
    return f_wrapper