astropy/astropy — pull request #2331 by mdboom (2014-04-17 18:34:08+00:00)
Title: sanitize_scale: Don't do expensive complex number handling if we don't have to.

This was found in #2315: It seems that the expensive complex number calculation is done even if the scale is not a complex number.

@mhvk: Is there a reason the original was written as it was? `np.iscomplex` actually checks whether the value has a non-zero imaginary part, which seems to be more appropriate.