def test_to_multiple(): a = np.random.randn(10) b = QA(a, 'm/s') with raises(ValueError): b.to('km/h', 'km/s')
def test_to(): a = np.random.randn(10) b = QA(a, 'mm') c = b.to('m') assert_almost_equal((c+c).view(np.ndarray)*1e3, a+a)
def test_to(): a = np.random.randn(10) b = QA(a, 'mm') c = b.to('m') assert_almost_equal((c + c).view(np.ndarray) * 1e3, a + a)