<commit_before>r"""User-API for the pyemma.coordinates package

.. currentmodule:: pyemma.coordinates.api
"""

__docformat__ = "restructuredtext en"


from pyemma.util.annotators import deprecated
from pyemma.util.log import getLogger

from pyemma.coordinates.pipeline import Discretizer as _Discretizer
# io
from io.featurizer import MDFeaturizer as _MDFeaturizer
from io.feature_reader import FeatureReader as _FeatureReader
from io.data_in_memory import DataInMemory as _DataInMemory
from pyemma.coordinates.io.frames_from_file import frames_from_file as _frames_from_file

# transforms
from transform.pca import PCA as _PCA
from transform.tica import TICA as _TICA
# clustering
from clustering.kmeans import KmeansClustering as _KmeansClustering
from clustering.uniform_time import UniformTimeClustering as _UniformTimeClustering
from clustering.regspace import RegularSpaceClustering as _RegularSpaceClustering
from clustering.assign import AssignCenters as _AssignCenters

logger = getLogger('coordinates.api')

__author__ = "<NAME>, <NAME>"
__copyright__ = "Copyright 2015, Computational Molecular Biology Group, FU-Berlin"
__credits__ = ["<NAME>", "<NAME>", "<NAME>"]
__license__ = "FreeBSD"
__version__ = "2.0.0"
__maintainer__ = "<NAME>"
__email__ = "m.scherer AT fu-berlin DOT de"

__all__ = ['discretizer',
           'featurizer',
           'feature_reader',
           'memory_reader',
           'tica',
           'pca',
           'cluster_regspace',
           'cluster_kmeans',
           'cluster_uniform_time',
           'cluster_assign_centers',
           # deprecated:
           'kmeans',
           'regspace',
           'assign_centers',
           'uniform_time',
           ]


def discretizer(reader,
                transform=None,
                cluster=None):
    """
    Constructs a discretizer object, which processes all data


    Parameters
    ----------

    reader : instance of :class:`pyemma.coordinates.io.reader.ChunkedReader`
        the reader instance provides access to the data. If you are working with
        MD data, you most likely want to use a FeatureReader.

    transform : instance of Transformer
        an optional transform like PCA/TICA etc.

    cluster : instance of clustering Transformer (optional)
        a cluster algorithm to assign transformed data to discrete states.


    Examples<commit_msg>[coordinates.api]: added save_traj and save_trajs to __all__<commit_after>r"""User-API for the pyemma.coordinates package

.. currentmodule:: pyemma.coordinates.api
"""

__docformat__ = "restructuredtext en"


from pyemma.util.annotators import deprecated
from pyemma.util.log import getLogger

from pyemma.coordinates.pipeline import Discretizer as _Discretizer
# io
from io.featurizer import MDFeaturizer as _MDFeaturizer
from io.feature_reader import FeatureReader as _FeatureReader
from io.data_in_memory import DataInMemory as _DataInMemory
from pyemma.coordinates.io.frames_from_file import frames_from_file as _frames_from_file

# transforms
from transform.pca import PCA as _PCA
from transform.tica import TICA as _TICA
# clustering
from clustering.kmeans import KmeansClustering as _KmeansClustering
from clustering.uniform_time import UniformTimeClustering as _UniformTimeClustering
from clustering.regspace import RegularSpaceClustering as _RegularSpaceClustering
from clustering.assign import AssignCenters as _AssignCenters

logger = getLogger('coordinates.api')

__author__ = "<NAME>, <NAME>"
__copyright__ = "Copyright 2015, Computational Molecular Biology Group, FU-Berlin"
__credits__ = ["<NAME>", "<NAME>", "<NAME>"]
__license__ = "FreeBSD"
__version__ = "2.0.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL> AT fu-berlin DOT de"

__all__ = ['discretizer',
           'featurizer',
           'feature_reader',
           'memory_reader',
           'tica',
           'pca',
           'cluster_regspace',
           'cluster_kmeans',
           'cluster_uniform_time',
           'cluster_assign_centers',
           # deprecated:
           'kmeans',
           'regspace',
           'assign_centers',
           'uniform_time',
           'save_traj',
           'save_trajs'
           ]


def discretizer(reader,
                transform=None,
                cluster=None):
    """
    Constructs a discretizer object, which processes all data


    Parameters
    ----------

    reader : instance of :class:`pyemma.coordinates.io.reader.ChunkedReader`
        the reader instance provides access to the data. If you are working with
        MD data, you most likely want to use a FeatureReader.

    transform : instance of Transformer
        an optional transform like PCA/TICA etc.

    cluster : instance of clustering Transformer (optional)
        a cluster algorithm to assign transformed data to discrete states.


    Examples
{'fraction_non_alphanumeric': 0.07773413272689683, 'fraction_numerical': 0.002894356005788712, 'mean_word_length': 3.292812777284827, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1748769', 'n_tokens_mistral': 1440, 'n_tokens_neox': 1328, 'n_words': 405}