parameters: (self)
docstring: Delete restart files that are no longer needed.
docstring_summary: Delete restart files that are no longer needed.
docstring_tokens: Delete restart files that are no longer needed .
function: def _ClearObsoleteRestartFiles(self):
          """Delete restart files that are no longer needed."""
          if self.max_files_to_keep > -1:
              self.restart_files = self._GetRestartFiles()
  
              number_of_obsolete_files = len(self.restart_files) - self.max_files_to_keep
              restart_file_keys = sorted(self.restart_files)
  
              for i in range(number_of_obsolete_files):
                  i_key = restart_file_keys[i]
                  file_path = os.path.join(self.__GetFolderPathSave(), self.restart_files[i_key])
                  KratosMultiphysics.kratos_utilities.DeleteFileIfExisting(file_path)
function_tokens: def _ClearObsoleteRestartFiles ( self ) : if self . max_files_to_keep > - 1 : self . restart_files = self . _GetRestartFiles ( ) number_of_obsolete_files = len ( self . restart_files ) - self . max_files_to_keep restart_file_keys = sorted ( self . restart_files ) for i in range ( number_of_obsolete_files ) : i_key = restart_file_keys [ i ] file_path = os . path . join ( self . __GetFolderPathSave ( ) , self . restart_files [ i_key ] ) KratosMultiphysics . kratos_utilities . DeleteFileIfExisting ( file_path )