# Path: pyvmd/collectors.py
# class Collector(object):
#     """
#     Base class for collectors. Collects data from trajectory and writes them into file.
#     """
#     # Format of the column header in the output
#     header_fmt = '%10s'
#     # Format of the data in the output
#     data_fmt = '%10.4f'
# 
#     # Counter for automatic name generation.
#     auto_name_counter = 0
# 
#     def __init__(self, name=None):
#         """
#         Create the collector.
# 
#         @param name: Name of the collector. If not provided, it is generated in form 'data#####'.
#         """
#         if name is None:
#             Collector.auto_name_counter += 1
#             name = 'data%05d' % Collector.auto_name_counter
#         self.name = name
# 
#     def collect(self, step):
#         """
#         Performs the analysis on the frame.
# 
#         Derived class must implement this method.
#         """
#         raise NotImplementedError
# 
# class FrameCollector(Collector):
#     """
#     Utility collector which collects frame number.
#     """
#     header_fmt = '%8s'
#     data_fmt = '%8d'
# 
#     def collect(self, step):
#         return step.frame


import logging
import numpy
from .collectors import Collector, FrameCollector
"""
Data sets to collect and store data from trajectory analysis.
"""



__all__ = ['DataSet']

LOGGER = logging.getLogger(__name__)


class DataSet(object):
    """
    Basic data set. Collects and stores data extracted from trajectory.
    """
    # Number of rows added when increasing size of data array
    step = 1000

    def __init__(self):
        # Array with data
        self._data = None
        # List of collectors
        self.collectors = []
        # Number of rows filled with data
        self._rows = 0

        # Register the frame collector

# Path: pyvmd/collectors.py
# class Collector(object):
#     """
#     Base class for collectors. Collects data from trajectory and writes them into file.
#     """
#     # Format of the column header in the output
#     header_fmt = '%10s'
#     # Format of the data in the output
#     data_fmt = '%10.4f'
# 
#     # Counter for automatic name generation.
#     auto_name_counter = 0
# 
#     def __init__(self, name=None):
#         """
#         Create the collector.
# 
#         @param name: Name of the collector. If not provided, it is generated in form 'data#####'.
#         """
#         if name is None:
#             Collector.auto_name_counter += 1
#             name = 'data%05d' % Collector.auto_name_counter
#         self.name = name
# 
#     def collect(self, step):
#         """
#         Performs the analysis on the frame.
# 
#         Derived class must implement this method.
#         """
#         raise NotImplementedError
# 
# class FrameCollector(Collector):
#     """
#     Utility collector which collects frame number.
#     """
#     header_fmt = '%8s'
#     data_fmt = '%8d'
# 
#     def collect(self, step):
#         return step.frame


# Path: pyvmd/datasets.py
import logging
import numpy
from .collectors import Collector, FrameCollector

"""
Data sets to collect and store data from trajectory analysis.
"""



__all__ = ['DataSet']

LOGGER = logging.getLogger(__name__)


class DataSet(object):
    """
    Basic data set. Collects and stores data extracted from trajectory.
    """
    # Number of rows added when increasing size of data array
    step = 1000

    def __init__(self):
        # Array with data
        self._data = None
        # List of collectors
        self.collectors = []
        # Number of rows filled with data
        self._rows = 0

        # Register the frame collector

        self.add_collector(FrameCollector('frame'))