def get_fragment(self, list_of_indextuples, give_only_index=False,
                     use_lookup=None):
        """Get the indices of the atoms in a fragment.

        The list_of_indextuples contains all bondings from the
        molecule to the fragment. ``[(1,3), (2,4)]`` means for example that the
        fragment is connected over two bonds. The first bond is from atom 1 in
        the molecule to atom 3 in the fragment. The second bond is from atom
        2 in the molecule to atom 4 in the fragment.

        Args:
            list_of_indextuples (list):
            give_only_index (bool): If ``True`` a set of indices
                is returned. Otherwise a new Cartesian instance.
            use_lookup (bool): Use a lookup variable for
                :meth:`~chemcoord.Cartesian.get_bonds`. The default is
                specified in ``settings['defaults']['use_lookup']``

        Returns:
            A set of indices or a new Cartesian instance.
        """
        if use_lookup is None:
            use_lookup = settings['defaults']['use_lookup']

        exclude = [tuple[0] for tuple in list_of_indextuples]
        index_of_atom = list_of_indextuples[0][1]
        fragment_index = self.get_coordination_sphere(
            index_of_atom, exclude=set(exclude), n_sphere=float('inf'),
            only_surface=False, give_only_index=True, use_lookup=use_lookup)
        if give_only_index:
            return fragment_index
        else:
            return self.loc[fragment_index, :]
def get_fragment ( self , list_of_indextuples , give_only_index = False , use_lookup = None ) : if use_lookup is None : use_lookup = settings [ 'defaults' ] [ 'use_lookup' ] exclude = [ tuple [ 0 ] for tuple in list_of_indextuples ] index_of_atom = list_of_indextuples [ 0 ] [ 1 ] fragment_index = self . get_coordination_sphere ( index_of_atom , exclude = set ( exclude ) , n_sphere = float ( 'inf' ) , only_surface = False , give_only_index = True , use_lookup = use_lookup ) if give_only_index : return fragment_index else : return self . loc [ fragment_index , : ]
Get the indices of the atoms in a fragment.

        The list_of_indextuples contains all bondings from the
        molecule to the fragment. ``[(1,3), (2,4)]`` means for example that the
        fragment is connected over two bonds. The first bond is from atom 1 in
        the molecule to atom 3 in the fragment. The second bond is from atom
        2 in the molecule to atom 4 in the fragment.

        Args:
            list_of_indextuples (list):
            give_only_index (bool): If ``True`` a set of indices
                is returned. Otherwise a new Cartesian instance.
            use_lookup (bool): Use a lookup variable for
                :meth:`~chemcoord.Cartesian.get_bonds`. The default is
                specified in ``settings['defaults']['use_lookup']``

        Returns:
            A set of indices or a new Cartesian instance.