def add_to(self, other):
<EOL>if type(other) is MaterialPackage:<EOL><INDENT>if self.material == other.material:<EOL><INDENT>self.compound_masses += other.compound_masses<EOL><DEDENT>else:<EOL><INDENT>for compound in other.material.compounds:<EOL><INDENT>if compound not in self.material.compounds:<EOL><INDENT>raise Exception("<STR_LIT>" + other.material.name +<EOL>"<STR_LIT>" +<EOL>self.material.name +<EOL>"<STR_LIT>" + compound +<EOL>"<STR_LIT>" +<EOL>self.material.name + "<STR_LIT>")<EOL><DEDENT>self.add_to((compound, other.get_compound_mass(compound)))<EOL><DEDENT><DEDENT><DEDENT>elif self._is_compound_mass_tuple(other):<EOL><INDENT>compound = other[<NUM_LIT:0>]<EOL>compound_index = self.material.get_compound_index(compound)<EOL>mass = other[<NUM_LIT:1>]<EOL>self.compound_masses[compound_index] += mass<EOL><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>
Add another chem material package to this material package.

:param other: The other material package.