pymatgen_diffusion/neb/full_path_mapper.py
def modify_path(self, paths):
        """
        This takes the results of get_intercalating_path() and turn them into an ordered path:
        The last hop is out of the unit cell, all previous hops stay within the unitcell

        Returns:
        list of ordered paths
        """

        for one_path in paths:
            if one_path[0][2]["to_jimage"] != (0, 0, 0):
                one_path = one_path[::-1]

            m_path = []

            if set(one_path[0][0:2]) == set(
                one_path[1][0:2]
            ):  # in case there is only 2 hops
                if one_path[0][0] == one_path[1][0]:
                    new_pos0 = one_path[0][1]
                    new_pos1 = one_path[0][0]
                    new_hop = (new_pos0, new_pos1, one_path[0][2])
                    m_path.append(new_hop)
                    m_path.append(one_path[1])
            else:
                start = list(set(one_path[0][0:2]) & set(one_path[-1][0:2]))[0]
                previous_point = start
                for one_hop_info in one_path:
                    one_hop = one_hop_info[0:2]
                    if one_hop[0] == previous_point:
                        m_path.append(one_hop_info)
                    if one_hop[1] == previous_point:
                        i_point = one_hop[1]
                        e_point = one_hop[0]
                        info = one_hop_info[2]
                        new_info = copy.deepcopy(info)
                        new_info["to_jimage"] = tuple([-u for u in info["to_jimage"]])
                        new_hop = (i_point, e_point, new_info)
                        m_path.append(new_hop)

                    previous_point = m_path[-1][1]
            yield m_path

        This takes the results of get_intercalating_path() and turn them into an ordered path:
        The last hop is out of the unit cell, all previous hops stay within the unitcell

        Returns:
        list of ordered paths
        
This takes the results of get_intercalating_path() and turn them into an ordered path:
The last hop is out of the unit cell, all previous hops stay within the unitcell
This takes the results of get_intercalating_path () and turn them into an ordered path : The last hop is out of the unit cell all previous hops stay within the unitcell
def modify_path(self, paths):
        for one_path in paths:
            if one_path[0][2]["to_jimage"] != (0, 0, 0):
                one_path = one_path[::-1]
            m_path = []
            if set(one_path[0][0:2]) == set(
                one_path[1][0:2]
            ):  
                if one_path[0][0] == one_path[1][0]:
                    new_pos0 = one_path[0][1]
                    new_pos1 = one_path[0][0]
                    new_hop = (new_pos0, new_pos1, one_path[0][2])
                    m_path.append(new_hop)
                    m_path.append(one_path[1])
            else:
                start = list(set(one_path[0][0:2]) & set(one_path[-1][0:2]))[0]
                previous_point = start
                for one_hop_info in one_path:
                    one_hop = one_hop_info[0:2]
                    if one_hop[0] == previous_point:
                        m_path.append(one_hop_info)
                    if one_hop[1] == previous_point:
                        i_point = one_hop[1]
                        e_point = one_hop[0]
                        info = one_hop_info[2]
                        new_info = copy.deepcopy(info)
                        new_info["to_jimage"] = tuple([-u for u in info["to_jimage"]])
                        new_hop = (i_point, e_point, new_info)
                        m_path.append(new_hop)
                    previous_point = m_path[-1][1]
            yield m_path
def modify_path ( self , paths ) : for one_path in paths : if one_path [ 0 ] [ 2 ] [ "to_jimage" ] != ( 0 , 0 , 0 ) : one_path = one_path [ : : - 1 ] m_path = [ ] if set ( one_path [ 0 ] [ 0 : 2 ] ) == set ( one_path [ 1 ] [ 0 : 2 ] ) : if one_path [ 0 ] [ 0 ] == one_path [ 1 ] [ 0 ] : new_pos0 = one_path [ 0 ] [ 1 ] new_pos1 = one_path [ 0 ] [ 0 ] new_hop = ( new_pos0 , new_pos1 , one_path [ 0 ] [ 2 ] ) m_path . append ( new_hop ) m_path . append ( one_path [ 1 ] ) else : start = list ( set ( one_path [ 0 ] [ 0 : 2 ] ) & set ( one_path [ - 1 ] [ 0 : 2 ] ) ) [ 0 ] previous_point = start for one_hop_info in one_path : one_hop = one_hop_info [ 0 : 2 ] if one_hop [ 0 ] == previous_point : m_path . append ( one_hop_info ) if one_hop [ 1 ] == previous_point : i_point = one_hop [ 1 ] e_point = one_hop [ 0 ] info = one_hop_info [ 2 ] new_info = copy . deepcopy ( info ) new_info [ "to_jimage" ] = tuple ( [ - u for u in info [ "to_jimage" ] ] ) new_hop = ( i_point , e_point , new_info ) m_path . append ( new_hop ) previous_point = m_path [ - 1 ] [ 1 ] yield m_path
This takes the results of get_intercalating_path() and turn them into an ordered path:
The last hop is out of the unit cell, all previous hops stay within the unitcell
This takes the results of get_intercalating_path () and turn them into an ordered path : The last hop is out of the unit cell all previous hops stay within the unitcell
"""
        This takes the results of get_intercalating_path() and turn them into an ordered path:
        The last hop is out of the unit cell, all previous hops stay within the unitcell

        Returns:
        list of ordered paths
        """ # in case there is only 2 hops
None
self
paths