def checkdataremains(func):
    """Decorate a filtering method, to raise a ValueError if all data filtered."""

    def wrapper(*args, **kwargs):

        reflections = func(*args, **kwargs)

        if not reflections:
            raise ValueError("All data has been filtered from the reflection table")
        return reflections

    return wrapper