# 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


import numpy as np
import openpathsampling as paths
from openpathsampling.integration_tools import (
    error_if_no_mdtraj, is_simtk_quantity_type, md
)
from openpathsampling.netcdfplus import StorableObject, LoaderProxy
                    for subtrj in subtrajectories]

    # ==========================================================================
    # UTILITY FUNCTIONS
    # ==========================================================================

    def to_mdtraj(self, topology=None):
        """
        Construct a mdtraj.Trajectory object from the Trajectory itself

        Parameters
        ----------
        topology : :class:`mdtraj.Topology`
            If not None this topology will be used to construct the mdtraj
            objects otherwise the topology object will be taken from the
            configurations in the trajectory snapshots.

        Returns
        -------
        :class:`mdtraj.Trajectory`
            the trajectory

        Notes
        -----

        If the OPS trajectory is zero-length (has no snapshots), then this
        fails. OPS cannot currently convert zero-length trajectories to
        MDTraj, because an OPS zero-length trajectory cannot determine its
        MDTraj topology.
        """

# 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/engines/trajectory.py
import numpy as np
import openpathsampling as paths
from openpathsampling.integration_tools import (
    error_if_no_mdtraj, is_simtk_quantity_type, md
)
from openpathsampling.netcdfplus import StorableObject, LoaderProxy

                    for subtrj in subtrajectories]

    # ==========================================================================
    # UTILITY FUNCTIONS
    # ==========================================================================

    def to_mdtraj(self, topology=None):
        """
        Construct a mdtraj.Trajectory object from the Trajectory itself

        Parameters
        ----------
        topology : :class:`mdtraj.Topology`
            If not None this topology will be used to construct the mdtraj
            objects otherwise the topology object will be taken from the
            configurations in the trajectory snapshots.

        Returns
        -------
        :class:`mdtraj.Trajectory`
            the trajectory

        Notes
        -----

        If the OPS trajectory is zero-length (has no snapshots), then this
        fails. OPS cannot currently convert zero-length trajectories to
        MDTraj, because an OPS zero-length trajectory cannot determine its
        MDTraj topology.
        """

        error_if_no_mdtraj("Converting to mdtraj")