<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def validate_units(self):
 """Ensure that wavelenth unit belongs to the correct class. There is no check for throughput because it is unitless. Raises ------ TypeError Wavelength unit is not `~pysynphot.units.WaveUnits`. """

        if (not isinstance(self.waveunits, units.WaveUnits)):
            raise TypeError("%s is not a valid WaveUnit" % self.waveunits)