def test_decompose_regression():
 q = ((np.array([1, 2, 3]) * u.m) / (2.0 * u.km))
 assert np.all((q.decompose().value == np.array([0.0005, 0.001, 0.0015])))
 assert np.all((q == ((np.array([1, 2, 3]) * u.m) / (2.0 * u.km))))
 assert np.all((q.decompose().value == np.array([0.0005, 0.001, 0.0015])))

def test_decompose_regression ( ) : q = ( ( np . array ( [ 1 , 2 , 3 ] ) * u . m ) / ( 2.0 * u . km ) ) assert np . all ( ( q . decompose ( ) . value == np . array ( [ 0.0005 , 0.001 , 0.0015 ] ) ) ) assert np . all ( ( q == ( ( np . array ( [ 1 , 2 , 3 ] ) * u . m ) / ( 2.0 * u . km ) ) ) ) assert np . all ( ( q . decompose ( ) . value == np . array ( [ 0.0005 , 0.001 , 0.0015 ] ) ) )
regression test for bug #1163 if decompose was called multiple times on a quantity with an array and a scale != 1 .