def addField(self, name, fieldParams, encoderParams):
assert fieldParams is not None and'<STR_LIT:type>' in fieldParams<EOL>dataClassName = fieldParams.pop('<STR_LIT:type>')<EOL>try:<EOL><INDENT>dataClass=eval(dataClassName)(fieldParams)<EOL><DEDENT>except TypeError as e:<EOL><INDENT>print(("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" % (dataClass, fieldParams)))<EOL>raise<EOL><DEDENT>encoderParams['<STR_LIT>']=dataClass<EOL>encoderParams['<STR_LIT>']=dataClassName<EOL>fieldIndex = self.defineField(name, encoderParams)<EOL>
Add a single field to the dataset.
        Parameters:
        -------------------------------------------------------------------
        name:             The user-specified name of the field
        fieldSpec:        A list of one or more dictionaries specifying parameters
                          to be used for dataClass initialization. Each dict must
                          contain the key 'type' that specifies a distribution for
                          the values in this field
        encoderParams:    Parameters for the field encoder