"platforms/cpu/tests/TestCpuLangevinIntegrator.cpp" did not exist on "5c4be2f0c72a9f6706991610e5fbac15b3893fcb"
Commit 83255aa8 authored by Jason Swails's avatar Jason Swails
Browse files

Add test for numpy units and update user's guide docs.

parent 4ae68749
......@@ -2865,7 +2865,7 @@ in and out.
[[10.0, 20.0, 30.0], [40.0, 50.0, 60.0]]
>>> import numpy
>>> a = Quantity(numpy.array([1,2,3]), centimeter)
>>> a = numpy.array([1,2,3]) * centimeter
>>> print(a)
[1 2 3] cm
>>> print(a/millimeter)
......
......@@ -638,6 +638,7 @@ class TestUnits(QuantityTestCase):
self.assertEqual(str(u.meters*u.meters), 'meter**2')
self.assertEqual(str(u.meter*u.meter), 'meter**2')
@unittest.skipIf(np is None, 'Skipping numpy units tests')
class TestNumpyUnits(QuantityTestCase):
def testNumpyQuantity(self):
......@@ -686,6 +687,6 @@ class TestNumpyUnits(QuantityTestCase):
b = a.reshape((5, 2))
self.assertTrue(u.is_quantity(b))
if np is None:
# Support lack of numpy
del TestNumpyUnits
def testMultiplication(self):
""" Tests that units override numpy.ndarray multiplication """
self.assertIsInstance(np.arange(10)*u.angstroms, u.Quantity)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment