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
7253aca3
Commit
7253aca3
authored
Jul 05, 2013
by
peastman
Browse files
Merge pull request #39 from rmcgibbo/numpy-compatibility
Improve numpy compatability
parents
d89beb8c
9349f496
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
wrappers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
...pers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
+4
-2
No files found.
wrappers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
View file @
7253aca3
...
@@ -5,6 +5,7 @@ try:
...
@@ -5,6 +5,7 @@ try:
except
:
except
:
pass
pass
import
sys
import
math
import
math
RMIN_PER_SIGMA
=
math
.
pow
(
2
,
1
/
6.0
)
RMIN_PER_SIGMA
=
math
.
pow
(
2
,
1
/
6.0
)
RVDW_PER_SIGMA
=
math
.
pow
(
2
,
1
/
6.0
)
/
2.0
RVDW_PER_SIGMA
=
math
.
pow
(
2
,
1
/
6.0
)
/
2.0
...
@@ -273,14 +274,15 @@ def stripUnits(args):
...
@@ -273,14 +274,15 @@ def stripUnits(args):
"""
"""
newArgList
=
[]
newArgList
=
[]
for
arg
in
args
:
for
arg
in
args
:
if
unit
.
is_quantity
(
arg
)
:
if
'
numpy
'
in
sys
.
modules
and
isinstance
(
arg
,
numpy
.
ndarray
)
:
arg
=
arg
.
tolist
()
elif
unit
.
is_quantity
(
arg
)
:
#
JDC
:
Ugly
workaround
for
OpenMM
using
'
bar
'
for
fundamental
pressure
unit
.
#
JDC
:
Ugly
workaround
for
OpenMM
using
'
bar
'
for
fundamental
pressure
unit
.
if
arg
.
unit
.
is_compatible
(
unit
.
bar
)
:
if
arg
.
unit
.
is_compatible
(
unit
.
bar
)
:
arg
=
arg
/
unit
.
bar
arg
=
arg
/
unit
.
bar
else
:
else
:
arg
=
arg
.
value_in_unit_system
(
unit
.
md_unit_system
)
arg
=
arg
.
value_in_unit_system
(
unit
.
md_unit_system
)
#
JDC
:
End
workaround
.
#
JDC
:
End
workaround
.
#
arg
=
arg
.
value_in_unit_system
(
unit
.
md_unit_system
)
elif
isinstance
(
arg
,
dict
)
:
elif
isinstance
(
arg
,
dict
)
:
newKeys
=
stripUnits
(
arg
.
keys
())
newKeys
=
stripUnits
(
arg
.
keys
())
newValues
=
stripUnits
(
arg
.
values
())
newValues
=
stripUnits
(
arg
.
values
())
...
...
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