Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
e23dc927
Unverified
Commit
e23dc927
authored
Dec 24, 2020
by
peastman
Committed by
GitHub
Dec 24, 2020
Browse files
Fixed errors passing Numpy int64 values for int arguments (#2961)
parent
84132b19
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
wrappers/python/src/swig_doxygen/swig_lib/python/features.i
wrappers/python/src/swig_doxygen/swig_lib/python/features.i
+4
-0
wrappers/python/tests/TestNumpyCompatibility.py
wrappers/python/tests/TestNumpyCompatibility.py
+6
-0
No files found.
wrappers/python/src/swig_doxygen/swig_lib/python/features.i
View file @
e23dc927
%
begin
%
{
#
define
SWIG_PYTHON_CAST_MODE
%
}
%
include
pythoncode
.
i
%
include
pythoncode
.
i
%
include
exceptions
.
i
%
include
exceptions
.
i
%
include
extend
.
i
%
include
extend
.
i
...
...
wrappers/python/tests/TestNumpyCompatibility.py
View file @
e23dc927
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment