merge_machine/abstract_data_project.py
def clean_after(self, module_name, file_name, delete_current_module=True):
        '''Removes all occurences of file (file_name) and transformations
        at and after the given module (module_name) based on the order in 
        self.MODULE_ORDER
        
        INPUT:
            - module_name
            - file_name
            - delete_current_module: also delete the file in module_name
        '''
        if file_name not in self.metadata['log']:
            logging.warning('File {0} was not found in logs'.format(file_name))
            return
        
        start_idx = self.MODULE_ORDER_log.index(module_name) + int(not delete_current_module)
        for iter_module_name in self.MODULE_ORDER_log[start_idx:]:            
            # module_log = self.metadata['log'][file_name]
            # TODO: check skipped, written instead of try except            
            try:
                self._remove(iter_module_name, file_name)   
                # os.remove(file_path)
                logging.warning('clean_after: Removed {0} / {1} (module_name: {2}, delete_current_module: {3})'.format(iter_module_name, file_name, module_name, delete_current_module))
            except FileNotFoundError:
                pass
            
            try:
                # Retrieve skip info # TODO: rather ugly
                skip = self.metadata['log'][file_name][iter_module_name].get('skipped', 'False')
                self.metadata['log'][file_name][iter_module_name] = copy.deepcopy(self.default_module_log)
                self.metadata['log'][file_name][iter_module_name]['skipped'] = skip
            except:
                pass
            self._write_metadata()
Removes all occurences of file (file_name) and transformations
        at and after the given module (module_name) based on the order in 
        self.MODULE_ORDER
        
        INPUT:
            - module_name
            - file_name
            - delete_current_module: also delete the file in module_name
        
Removes all occurences of file (file_name) and transformations
at and after the given module (module_name) based on the order in
self.MODULE_ORDER


Removes all occurences of file ( file_name ) and transformations at and after the given module ( module_name ) based on the order in self . MODULE_ORDER
def clean_after(self, module_name, file_name, delete_current_module=True):
        if file_name not in self.metadata['log']:
            logging.warning('File {0} was not found in logs'.format(file_name))
            return
        start_idx = self.MODULE_ORDER_log.index(module_name) + int(not delete_current_module)
        for iter_module_name in self.MODULE_ORDER_log[start_idx:]:            
            try:
                self._remove(iter_module_name, file_name)   
                logging.warning('clean_after: Removed {0} / {1} (module_name: {2}, delete_current_module: {3})'.format(iter_module_name, file_name, module_name, delete_current_module))
            except FileNotFoundError:
                pass
            try:
                skip = self.metadata['log'][file_name][iter_module_name].get('skipped', 'False')
                self.metadata['log'][file_name][iter_module_name] = copy.deepcopy(self.default_module_log)
                self.metadata['log'][file_name][iter_module_name]['skipped'] = skip
            except:
                pass
            self._write_metadata()
def clean_after ( self , module_name , file_name , delete_current_module = True ) : if file_name not in self . metadata [ 'log' ] : logging . warning ( 'File {0} was not found in logs' . format ( file_name ) ) return start_idx = self . MODULE_ORDER_log . index ( module_name ) + int ( not delete_current_module ) for iter_module_name in self . MODULE_ORDER_log [ start_idx : ] : try : self . _remove ( iter_module_name , file_name ) logging . warning ( 'clean_after: Removed {0} / {1} (module_name: {2}, delete_current_module: {3})' . format ( iter_module_name , file_name , module_name , delete_current_module ) ) except FileNotFoundError : pass try : skip = self . metadata [ 'log' ] [ file_name ] [ iter_module_name ] . get ( 'skipped' , 'False' ) self . metadata [ 'log' ] [ file_name ] [ iter_module_name ] = copy . deepcopy ( self . default_module_log ) self . metadata [ 'log' ] [ file_name ] [ iter_module_name ] [ 'skipped' ] = skip except : pass self . _write_metadata ( )
Removes all occurences of file (file_name) and transformations
at and after the given module (module_name) based on the order in
self.MODULE_ORDER
Removes all occurences of file ( file_name ) and transformations at and after the given module ( module_name ) based on the order in self . MODULE_ORDER
'''Removes all occurences of file (file_name) and transformations
        at and after the given module (module_name) based on the order in 
        self.MODULE_ORDER
        
        INPUT:
            - module_name
            - file_name
            - delete_current_module: also delete the file in module_name
        ''' # module_log = self.metadata['log'][file_name] # TODO: check skipped, written instead of try except             # os.remove(file_path) # Retrieve skip info # TODO: rather ugly
self
module_name
file_name
delete_current_module