merge_machine/normalizer.py
def add_selected_columns(self, columns):
        '''
        Select the columns to normalize on. Will clear all changes if more columns 
        are selected than previously (clean_after)
        '''
        # Check that columns were selected
        if not columns:
            raise ValueError('Select at least one column')
        
        # Check that selected columns are in the original header
        for col in columns:
            if col not in self.metadata['column_tracker']['original']:
                raise ValueError('Selected column {0} is not in uploaded file (can be different from the original file)\n --> uploaded header: ({1})'.format(\
                                col, self.metadata['column_tracker']['original']))
        
        # If a selected column was not previously selected, delete all 
        # pre-existing files. Because we will have to re-run processing 
        if any(col not in self.metadata['column_tracker']['selected'] for col in columns):
            for file_name in self.metadata['files']:
                self.clean_after('INIT', file_name, delete_current_module=False)

        # Add to log
        for file_name in self.metadata['log']:
            self.metadata['log'][file_name]['add_selected_columns']['completed'] = True
        
        # Add selected columns to metadata
        self.metadata['column_tracker']['selected'] = columns
        
        self._write_metadata()

        Select the columns to normalize on. Will clear all changes if more columns 
        are selected than previously (clean_after)
        
Select the columns to normalize on. Will clear all changes if more columns
are selected than previously (clean_after)
Select the columns to normalize on . Will clear all changes if more columns are selected than previously ( clean_after )
def add_selected_columns(self, columns):
        if not columns:
            raise ValueError('Select at least one column')
        for col in columns:
            if col not in self.metadata['column_tracker']['original']:
                raise ValueError('Selected column {0} is not in uploaded file (can be different from the original file)\n --> uploaded header: ({1})'.format(\
                                col, self.metadata['column_tracker']['original']))
        if any(col not in self.metadata['column_tracker']['selected'] for col in columns):
            for file_name in self.metadata['files']:
                self.clean_after('INIT', file_name, delete_current_module=False)
        for file_name in self.metadata['log']:
            self.metadata['log'][file_name]['add_selected_columns']['completed'] = True
        self.metadata['column_tracker']['selected'] = columns
        self._write_metadata()
def add_selected_columns ( self , columns ) : if not columns : raise ValueError ( 'Select at least one column' ) for col in columns : if col not in self . metadata [ 'column_tracker' ] [ 'original' ] : raise ValueError ( 'Selected column {0} is not in uploaded file (can be different from the original file)\n --> uploaded header: ({1})' . format ( col , self . metadata [ 'column_tracker' ] [ 'original' ] ) ) if any ( col not in self . metadata [ 'column_tracker' ] [ 'selected' ] for col in columns ) : for file_name in self . metadata [ 'files' ] : self . clean_after ( 'INIT' , file_name , delete_current_module = False ) for file_name in self . metadata [ 'log' ] : self . metadata [ 'log' ] [ file_name ] [ 'add_selected_columns' ] [ 'completed' ] = True self . metadata [ 'column_tracker' ] [ 'selected' ] = columns self . _write_metadata ( )
Select the columns to normalize on.
Select the columns to normalize on .
'''
        Select the columns to normalize on. Will clear all changes if more columns 
        are selected than previously (clean_after)
        ''' # Check that columns were selected # Check that selected columns are in the original header # If a selected column was not previously selected, delete all  # pre-existing files. Because we will have to re-run processing  # Add to log # Add selected columns to metadata
self
columns