def add_assay(self, name, solid_density, H2O_fraction, assay):
if not type(solid_density) is float:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>self.solid_densities[name] = solid_density<EOL>if not type(H2O_fraction) is float:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>self.H2O_fractions[name] = H2O_fraction<EOL>if not type(assay) is numpy.ndarray:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>elif not assay.shape == (self.size_class_count,):<EOL><INDENT>raise Exception(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>elif name in self.assays.keys():<EOL><INDENT>raise Exception(<EOL>"<STR_LIT>")<EOL><DEDENT>self.assays[name] = assay<EOL>
Add an assay to the material.

        :param name: The name of the new assay.
        :param assay: A numpy array containing the size class mass fractions
          for the assay. The sequence of the assay's elements must correspond
          to the sequence of the material's size classes.