merge_machine/preprocess_fields_v3.py
def normalize_values_in_place(self, types):
		''' Generates (original field name, modified field values) pairs for each output field and each cell that is 
		 actually modified (even just changing a single character's case). '''
		for (h, f) in self.fields.items():
			fieldName = h.value
			if fieldName not in types:
				logging.warning('No values to normalize for {}'.format(fieldName))
				continue
			logging.info('Normalizing values for {}'.format(fieldName))
			lvt = types[fieldName]
			assert self.entries == len(f.cells)
			newCol = [''] * self.entries
			mod_count = 0
			for i, c in enumerate(f.cells):
				nvs = list(c.normalized_values_in_place(lvt))
				newCol[i] = ', '.join(nvs)
				if c.value != newCol[i]: 
					logging.debug('Field {} recoded: {} --> {}'.format(fieldName, c.value, newCol[i]))
					mod_count += 1
			logging.debug('Field {} recoded: {} / {} total'.format(fieldName, mod_count, len(f.cells)))
			yield (fieldName, newCol)
 Generates (original field name, modified field values) pairs for each output field and each cell that is 
		 actually modified (even just changing a single character's case). 
Generates (original field name, modified field values) pairs for each output field and each cell that is
actually modified (even just changing a single character's case).
Generates ( original field name modified field values ) pairs for each output field and each cell that is actually modified ( even just changing a single character ' s case ) .
def normalize_values_in_place(self, types):
		for (h, f) in self.fields.items():
			fieldName = h.value
			if fieldName not in types:
				logging.warning('No values to normalize for {}'.format(fieldName))
				continue
			logging.info('Normalizing values for {}'.format(fieldName))
			lvt = types[fieldName]
			assert self.entries == len(f.cells)
			newCol = [''] * self.entries
			mod_count = 0
			for i, c in enumerate(f.cells):
				nvs = list(c.normalized_values_in_place(lvt))
				newCol[i] = ', '.join(nvs)
				if c.value != newCol[i]: 
					logging.debug('Field {} recoded: {} --> {}'.format(fieldName, c.value, newCol[i]))
					mod_count += 1
			logging.debug('Field {} recoded: {} / {} total'.format(fieldName, mod_count, len(f.cells)))
			yield (fieldName, newCol)
def normalize_values_in_place ( self , types ) : for ( h , f ) in self . fields . items ( ) : fieldName = h . value if fieldName not in types : logging . warning ( 'No values to normalize for {}' . format ( fieldName ) ) continue logging . info ( 'Normalizing values for {}' . format ( fieldName ) ) lvt = types [ fieldName ] assert self . entries == len ( f . cells ) newCol = [ '' ] * self . entries mod_count = 0 for i , c in enumerate ( f . cells ) : nvs = list ( c . normalized_values_in_place ( lvt ) ) newCol [ i ] = ', ' . join ( nvs ) if c . value != newCol [ i ] : logging . debug ( 'Field {} recoded: {} --> {}' . format ( fieldName , c . value , newCol [ i ] ) ) mod_count += 1 logging . debug ( 'Field {} recoded: {} / {} total' . format ( fieldName , mod_count , len ( f . cells ) ) ) yield ( fieldName , newCol )
Generates (original field name, modified field values) pairs for each output field and each cell that is
actually modified (even just changing a single character's case).
Generates ( original field name modified field values ) pairs for each output field and each cell that is actually modified ( even just changing a single character ' s case ) .
''' Generates (original field name, modified field values) pairs for each output field and each cell that is 
		 actually modified (even just changing a single character's case). '''
self
types