# Path: openpathsampling/integration_tools.py
# def error_if_no(name, package_name, has_package):
# def _chain_import(*packages):
# def error_if_no_simtk_unit(name):
# def error_if_no_mdtraj(name):
# def error_if_to_openmm(name):
#     HAS_SIMTK_UNIT = False
#     HAS_SIMTK_UNIT = True
#     HAS_MDTRAJ = False
#     HAS_MDTRAJ = True
#     HAS_OPENMM = False
#     HAS_OPENMM = True
# 
# Path: openpathsampling/deprecations.py
# def has_deprecations(cls):
#     """Decorator to ensure that docstrings get updated for wrapped class"""
#     for obj in [cls] + list(vars(cls).values()):
#         if callable(obj) and hasattr(obj, '__new_docstring'):
#             try:
#                 obj.__doc__ = obj.__new_docstring
#             except AttributeError:
#                 # probably Python 2; we can't update docstring in Py2
#                 # see https://github.com/Chilipp/docrep/pull/9 and related
#                 pass
#             del obj.__new_docstring
#     return cls
# 
# def deprecate(deprecation):
#     """Decorator to deprecate a class/method
# 
#     Note
#     ----
#         Properties can be particularly challenging. First, you must put the
#         @property decorator outside (above) the @deprecate decorator.
#         Second, this does not (yet) change the docstrings of properties.
#         However, it will raise a warning when the property is used.
#     """
#     def decorator(dep_obj):
#         dep_obj.__new_docstring = update_docstring(dep_obj, deprecation)
#         wrap_class = isclass(dep_obj)
#         to_wrap = dep_obj.__init__ if wrap_class else dep_obj
# 
#         @wraps(to_wrap)
#         def wrapper(*args, **kwargs):
#             deprecation.warn()
#             return to_wrap(*args, **kwargs)
# 
#         if wrap_class:
#             dep_obj.__init__ = wrapper
#             return dep_obj
#         else:
#             return wrapper
#     return decorator
# 
# MSMBUILDER = Deprecation(
#     problem=("MSMBuilder is no longer maintained. "
#              + "MSMBFeaturizer is no longer officially supported."),
#     remedy="Create a CoordinateFunctionCV based on MSMBuilderFeaturizers.",
#     remove_version=(2, 0),
#     deprecated_in=(1, 1, 0)
# )


import openpathsampling as paths
import openpathsampling.netcdfplus.chaindict as cd
import sys
        import pyemma.coordinates
from openpathsampling.integration_tools import md, error_if_no_mdtraj
from openpathsampling.engines.openmm.tools import trajectory_to_mdtraj
from openpathsampling.netcdfplus import WeakKeyCache, \
    ObjectJSON, create_to_dict, ObjectStore, PseudoAttribute
from openpathsampling.deprecations import (has_deprecations, deprecate,
                                           MSMBUILDER)
        )

    def to_dict(self):
        dct = super(CoordinateFunctionCV, self).to_dict()
        del dct['cv_time_reversible']
        return dct


class GeneratorCV(CallableCV):
    """Turn a callable class or function generating a callable object into a CV

    The class instance will be called with snapshots. The instance itself
    will be created using the given ``**kwargs``.
    """

    def __init__(
            self,
            name,
            generator,
            cv_time_reversible=False,
            cv_requires_lists=False,
            cv_wrap_numpy_array=False,
            cv_scalarize_numpy_singletons=False,
            **kwargs
    ):
        r"""
        Parameters
        ----------
        name
        generator : callable class

# Path: openpathsampling/integration_tools.py
# def error_if_no(name, package_name, has_package):
# def _chain_import(*packages):
# def error_if_no_simtk_unit(name):
# def error_if_no_mdtraj(name):
# def error_if_to_openmm(name):
#     HAS_SIMTK_UNIT = False
#     HAS_SIMTK_UNIT = True
#     HAS_MDTRAJ = False
#     HAS_MDTRAJ = True
#     HAS_OPENMM = False
#     HAS_OPENMM = True
# 
# Path: openpathsampling/deprecations.py
# def has_deprecations(cls):
#     """Decorator to ensure that docstrings get updated for wrapped class"""
#     for obj in [cls] + list(vars(cls).values()):
#         if callable(obj) and hasattr(obj, '__new_docstring'):
#             try:
#                 obj.__doc__ = obj.__new_docstring
#             except AttributeError:
#                 # probably Python 2; we can't update docstring in Py2
#                 # see https://github.com/Chilipp/docrep/pull/9 and related
#                 pass
#             del obj.__new_docstring
#     return cls
# 
# def deprecate(deprecation):
#     """Decorator to deprecate a class/method
# 
#     Note
#     ----
#         Properties can be particularly challenging. First, you must put the
#         @property decorator outside (above) the @deprecate decorator.
#         Second, this does not (yet) change the docstrings of properties.
#         However, it will raise a warning when the property is used.
#     """
#     def decorator(dep_obj):
#         dep_obj.__new_docstring = update_docstring(dep_obj, deprecation)
#         wrap_class = isclass(dep_obj)
#         to_wrap = dep_obj.__init__ if wrap_class else dep_obj
# 
#         @wraps(to_wrap)
#         def wrapper(*args, **kwargs):
#             deprecation.warn()
#             return to_wrap(*args, **kwargs)
# 
#         if wrap_class:
#             dep_obj.__init__ = wrapper
#             return dep_obj
#         else:
#             return wrapper
#     return decorator
# 
# MSMBUILDER = Deprecation(
#     problem=("MSMBuilder is no longer maintained. "
#              + "MSMBFeaturizer is no longer officially supported."),
#     remedy="Create a CoordinateFunctionCV based on MSMBuilderFeaturizers.",
#     remove_version=(2, 0),
#     deprecated_in=(1, 1, 0)
# )


# Path: openpathsampling/collectivevariable.py
import openpathsampling as paths
import openpathsampling.netcdfplus.chaindict as cd
import sys
        import pyemma.coordinates
from openpathsampling.integration_tools import md, error_if_no_mdtraj
from openpathsampling.engines.openmm.tools import trajectory_to_mdtraj
from openpathsampling.netcdfplus import WeakKeyCache, \
    ObjectJSON, create_to_dict, ObjectStore, PseudoAttribute
from openpathsampling.deprecations import (has_deprecations, deprecate,
                                           MSMBUILDER)

        )

    def to_dict(self):
        dct = super(CoordinateFunctionCV, self).to_dict()
        del dct['cv_time_reversible']
        return dct


class GeneratorCV(CallableCV):
    """Turn a callable class or function generating a callable object into a CV

    The class instance will be called with snapshots. The instance itself
    will be created using the given ``**kwargs``.
    """

    def __init__(
            self,
            name,
            generator,
            cv_time_reversible=False,
            cv_requires_lists=False,
            cv_wrap_numpy_array=False,
            cv_scalarize_numpy_singletons=False,
            **kwargs
    ):
        r"""
        Parameters
        ----------
        name
        generator : callable class

            a class where instances have a ``__call__`` attribute