Unverified Commit e23dc927 authored by peastman's avatar peastman Committed by GitHub
Browse files

Fixed errors passing Numpy int64 values for int arguments (#2961)

parent 84132b19
%begin %{
#define SWIG_PYTHON_CAST_MODE
%}
%include pythoncode.i %include pythoncode.i
%include exceptions.i %include exceptions.i
%include extend.i %include extend.i
......
...@@ -91,6 +91,12 @@ class TestNumpyCompatibility(unittest.TestCase): ...@@ -91,6 +91,12 @@ class TestNumpyCompatibility(unittest.TestCase):
self.assertEqual(size, 10) self.assertEqual(size, 10)
np.testing.assert_array_almost_equal(energy, np.asarray(energy_out)) np.testing.assert_array_almost_equal(energy, np.asarray(energy_out))
def test_int64(self):
indices = np.array([0,1,2])
sys = mm.System()
sys.addParticle(2.0)
assert sys.getParticleMass(indices[0]) == 2.0*unit.amu
@unittest.skipIf(NUMPY_IMPORT_FAILED, 'Numpy is not installed') @unittest.skipIf(NUMPY_IMPORT_FAILED, 'Numpy is not installed')
class TestNumpyUnits(unittest.TestCase): class TestNumpyUnits(unittest.TestCase):
......
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