# Path: wyrm/processing.py
# def append_cnt(dat, dat2, timeaxis=-2, extra=None):
#     """Append two continuous data objects.
# 
#     This method uses :func:`append` to append to continuous data
#     objects. It also takes care that the resulting continuous will have
#     a correct ``.axes[timeaxis]``. For that it uses the ``.fs``
#     attribute and the length of the data to recalculate the timeaxis.
# 
#     If both ``dat`` and ``dat2`` have the ``markers`` attribute, the
#     markers will be treated properly (i.e. by moving the markers of
#     ``dat2`` by ``dat`` milliseconds to the right.
# 
#     Parameters
#     ----------
#     dat, dat2 : Data
#     timeaxis : int, optional
#     extra: list of strings, optional
# 
#     Returns
#     -------
#     dat : Data
#         the resulting combination of ``dat`` and ``dat2``
# 
#     Raises
#     ------
#     AssertionError
#         if at least one of the ``Data`` parameters has not the ``.fs``
#         attribute or if the ``.fs`` attributes are not equal.
# 
#     See Also
#     --------
#     append, append_epo
# 
#     Examples
#     --------
# 
#     >>> cnt.axis[0]
#     [0, 1, 2]
#     >>> cnt2.axis[0]
#     [0, 1, 2]
#     >>> cnt.fs
#     1000
#     >>> cnt = append_cnt(cnt, cnt2)
#     >>> cnt.axis[0]
#     [0, 1, 2, 3, 4, 5]
# 
#     """
#     assert hasattr(dat, 'fs') and hasattr(dat2, 'fs')
#     assert dat.fs == dat2.fs
#     cnt = append(dat, dat2, axis=timeaxis, extra=extra)
#     if hasattr(dat, 'markers') and hasattr(dat2, 'markers'):
#         # move the markers from dat2 to the right by dat-milliseconds
#         ms = dat.data.shape[timeaxis] / dat.fs * 1000
#         markers1 = dat.markers[:]
#         markers2 = [[x[0]+ms, x[1]] for x in dat2.markers]
#         markers1.extend(markers2)
#         cnt.markers = markers1
#     # fix the timeaxis from 0, 1, 2, 0, 1, 2 -> 0, 1, 2, 3, 4, 5
#     ms = cnt.data.shape[timeaxis] / cnt.fs * 1000
#     cnt.axes[timeaxis] = np.linspace(0, ms, cnt.data.shape[timeaxis], endpoint=False)
#     return cnt


import copy
import logging
import numpy as np
from wyrm.processing import append_cnt
    """

    def __init__(self, samples=50):
        """Initialize the Block Buffer.

        Parameters
        ----------
        samples : int, optional
            the desired block length in samples

        """
        self.samples = samples
        self.dat = None

    def append(self, dat):
        """Append data to the Block Buffer.

        This method accumulates the incoming data.

        Parameters
        ----------
        dat : Data
            continuous Data object

        """
        if self.dat is None:
            self.dat = dat.copy()
        elif not dat:
            pass
        else:

# Path: wyrm/processing.py
# def append_cnt(dat, dat2, timeaxis=-2, extra=None):
#     """Append two continuous data objects.
# 
#     This method uses :func:`append` to append to continuous data
#     objects. It also takes care that the resulting continuous will have
#     a correct ``.axes[timeaxis]``. For that it uses the ``.fs``
#     attribute and the length of the data to recalculate the timeaxis.
# 
#     If both ``dat`` and ``dat2`` have the ``markers`` attribute, the
#     markers will be treated properly (i.e. by moving the markers of
#     ``dat2`` by ``dat`` milliseconds to the right.
# 
#     Parameters
#     ----------
#     dat, dat2 : Data
#     timeaxis : int, optional
#     extra: list of strings, optional
# 
#     Returns
#     -------
#     dat : Data
#         the resulting combination of ``dat`` and ``dat2``
# 
#     Raises
#     ------
#     AssertionError
#         if at least one of the ``Data`` parameters has not the ``.fs``
#         attribute or if the ``.fs`` attributes are not equal.
# 
#     See Also
#     --------
#     append, append_epo
# 
#     Examples
#     --------
# 
#     >>> cnt.axis[0]
#     [0, 1, 2]
#     >>> cnt2.axis[0]
#     [0, 1, 2]
#     >>> cnt.fs
#     1000
#     >>> cnt = append_cnt(cnt, cnt2)
#     >>> cnt.axis[0]
#     [0, 1, 2, 3, 4, 5]
# 
#     """
#     assert hasattr(dat, 'fs') and hasattr(dat2, 'fs')
#     assert dat.fs == dat2.fs
#     cnt = append(dat, dat2, axis=timeaxis, extra=extra)
#     if hasattr(dat, 'markers') and hasattr(dat2, 'markers'):
#         # move the markers from dat2 to the right by dat-milliseconds
#         ms = dat.data.shape[timeaxis] / dat.fs * 1000
#         markers1 = dat.markers[:]
#         markers2 = [[x[0]+ms, x[1]] for x in dat2.markers]
#         markers1.extend(markers2)
#         cnt.markers = markers1
#     # fix the timeaxis from 0, 1, 2, 0, 1, 2 -> 0, 1, 2, 3, 4, 5
#     ms = cnt.data.shape[timeaxis] / cnt.fs * 1000
#     cnt.axes[timeaxis] = np.linspace(0, ms, cnt.data.shape[timeaxis], endpoint=False)
#     return cnt


# Path: wyrm/types.py
import copy
import logging
import numpy as np
from wyrm.processing import append_cnt

    """

    def __init__(self, samples=50):
        """Initialize the Block Buffer.

        Parameters
        ----------
        samples : int, optional
            the desired block length in samples

        """
        self.samples = samples
        self.dat = None

    def append(self, dat):
        """Append data to the Block Buffer.

        This method accumulates the incoming data.

        Parameters
        ----------
        dat : Data
            continuous Data object

        """
        if self.dat is None:
            self.dat = dat.copy()
        elif not dat:
            pass
        else:

            self.dat = append_cnt(self.dat, dat)