def __add__(self, other):
<EOL>if type(other) is MaterialPackage:<EOL><INDENT>if self.material == other.material:  <EOL><INDENT>result = MaterialPackage(self.material,<EOL>self._compound_masses +<EOL>other._compound_masses)<EOL>result.H = self._H + other._H<EOL>result.P = self.P<EOL>return result<EOL><DEDENT>else:  <EOL><INDENT>H = self.H + other.H<EOL>result = self.clone()<EOL>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>result = result + (compound,<EOL>other.get_compound_mass(compound))<EOL><DEDENT>result.H = H<EOL>return result<EOL><DEDENT><DEDENT>elif self._is_compound_mass_tuple(other):<EOL><INDENT>compound = other[<NUM_LIT:0>]<EOL>index = self.material.get_compound_index(compound)<EOL>mass = other[<NUM_LIT:1>]<EOL>enthalpy = thermo.H(compound, self._T, mass)<EOL>result = self.clone()<EOL>result._compound_masses[index] = result._compound_masses[index] +mass<EOL>result._H += enthalpy<EOL>result._P = self._P<EOL>return result<EOL><DEDENT>elif self._is_compound_mass_temperature_tuple(other):<EOL><INDENT>compound = other[<NUM_LIT:0>]<EOL>index = self.material.get_compound_index(compound)<EOL>mass = other[<NUM_LIT:1>]<EOL>temperature = other[<NUM_LIT:2>]<EOL>enthalpy = thermo.H(compound, temperature, mass)<EOL>result = self * <NUM_LIT:1.0><EOL>result._compound_masses[index] = result._compound_masses[index] +mass<EOL>result.H = self._H + enthalpy<EOL>result._P = self._P<EOL>return result<EOL><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>
Addition operator (+).

Add this package (self) and 'other' together, return the result as a
new package, and leave self unchanged.

:param other: Can can be one of the following:
         1. MaterialPackage
            'other' is added to self to create a new package.
         2. tuple: (compound, mass)
            The specified mass of the specified compound is added to \
            self, assuming the added material has the same \
            temperature as self.
         3. tuple: (compound, mass, temperature)
            The specified mass of the specified compound at the \
            specified temperature is added to self.

:returns: A new Material package that is the sum of self and 'other'.