# Path: pysaliency/utils.py
# def remove_trailing_nans(data):
#     """Filters a scanpath arrays to remove the ending part of nans."""
#     for i in range(len(data)):
#         if np.all(np.isnan(data[i:])):
#             return data[:i]
#     return data


from abc import ABCMeta, abstractmethod
from six import add_metaclass
from .utils import remove_trailing_nans
from __future__ import print_function, absolute_import, division, unicode_literals




@add_metaclass(ABCMeta)
class SamplingModelMixin(object):
    """A sampling model is supports sampling fixations and whole scanpaths."""
    def sample_scanpath(
        self, stimulus, x_hist, y_hist, t_hist, samples, attributes=None, verbose=False, rst=None
    ):
        """return xs, ys, ts"""

# Path: pysaliency/utils.py
# def remove_trailing_nans(data):
#     """Filters a scanpath arrays to remove the ending part of nans."""
#     for i in range(len(data)):
#         if np.all(np.isnan(data[i:])):
#             return data[:i]
#     return data


# Path: pysaliency/sampling_models.py
from abc import ABCMeta, abstractmethod
from six import add_metaclass
from .utils import remove_trailing_nans

from __future__ import print_function, absolute_import, division, unicode_literals




@add_metaclass(ABCMeta)
class SamplingModelMixin(object):
    """A sampling model is supports sampling fixations and whole scanpaths."""
    def sample_scanpath(
        self, stimulus, x_hist, y_hist, t_hist, samples, attributes=None, verbose=False, rst=None
    ):
        """return xs, ys, ts"""

        xs = list(remove_trailing_nans(x_hist))