def rebuild_system(self, override=False, **kwargs):
        """
        Rebuild molecules in molecular system.

        Parameters
        ----------
        override : :class:`bool`, optional (default=False)
            If False the rebuild molecular system is returned as a new
            :class:`MolecularSystem`, if True, the current
            :class:`MolecularSystem` is modified.

        """
        # First we create a 3x3x3 supercell with the initial unit cell in the
        # centre and the 26 unit cell translations around to provide all the
        # atom positions necessary for the molecules passing through periodic
        # boundary reconstruction step.
        supercell_333 = create_supercell(self.system, **kwargs)
        # smolsys = self.load_system(supercell_333, self.system_id + '_311')
        # smolsys.dump_system(override=True)
        discrete = discrete_molecules(self.system, rebuild=supercell_333)
        # This function overrides the initial data for 'coordinates',
        # 'atom_ids', and 'elements' instances in the 'system' dictionary.
        coordinates = np.array([], dtype=np.float64).reshape(0, 3)
        atom_ids = np.array([])
        elements = np.array([])
        for i in discrete:
            coordinates = np.concatenate(
                [coordinates, i['coordinates']], axis=0
                )
            atom_ids = np.concatenate([atom_ids, i['atom_ids']], axis=0)
            elements = np.concatenate([elements, i['elements']], axis=0)
        rebuild_system = {
            'coordinates': coordinates,
            'atom_ids': atom_ids,
            'elements': elements
            }
        if override is True:
            self.system.update(rebuild_system)
            return None
        else:
            return self.load_system(rebuild_system)
def rebuild_system ( self , override = False , ** kwargs ) : supercell_333 = create_supercell ( self . system , ** kwargs ) discrete = discrete_molecules ( self . system , rebuild = supercell_333 ) coordinates = np . array ( [ ] , dtype = np . float64 ) . reshape ( 0 , 3 ) atom_ids = np . array ( [ ] ) elements = np . array ( [ ] ) for i in discrete : coordinates = np . concatenate ( [ coordinates , i [ 'coordinates' ] ] , axis = 0 ) atom_ids = np . concatenate ( [ atom_ids , i [ 'atom_ids' ] ] , axis = 0 ) elements = np . concatenate ( [ elements , i [ 'elements' ] ] , axis = 0 ) rebuild_system = { 'coordinates' : coordinates , 'atom_ids' : atom_ids , 'elements' : elements } if override is True : self . system . update ( rebuild_system ) return None else : return self . load_system ( rebuild_system )
Rebuild molecules in molecular system.

        Parameters
        ----------
        override : :class:`bool`, optional (default=False)
            If False the rebuild molecular system is returned as a new
            :class:`MolecularSystem`, if True, the current
            :class:`MolecularSystem` is modified.