astropy/astropy — pull request #2003 by embray (2014-05-05 20:13:31+00:00)
Title: units: quantity bug with adding units to an array view?

This code doesn't work as expected:

a = np.random.uniform(size=(400,8))

x,y,z = a[:,1:4].T*u.km/u.s
print np.sum(a[:,1]*u.km/u.s - x) # non-zero

x,y,z = a[:,1:4].T
print np.sum(a[:,1] - x) # zero

Could this have something to do with how numpy views of arrays are turned into `Quantity`'s? Don't have time to look at code today to investigate...