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
7ba1a10c
Commit
7ba1a10c
authored
Jul 05, 2013
by
Peter Eastman
Browse files
Merge branch 'master' of
https://github.com/SimTk/openmm
parents
c698141a
7253aca3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
wrappers/python/src/swig_doxygen/OpenMM.i
wrappers/python/src/swig_doxygen/OpenMM.i
+8
-0
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/OpenMM.i
View file @
7ba1a10c
...
...
@@ -64,6 +64,14 @@ using namespace OpenMM;
%
include
OpenMM_headers
.
i
%
pythoncode
%
{
#
when
we
import
*
from
the
python
module
,
we
only
want
to
import
the
#
actual
classes
,
and
not
the
swigregistration
methods
,
which
have
already
#
been
called
,
and
are
now
unneeded
by
the
user
code
,
and
only
pollute
the
#
namespace
__all__
=
[
k
for
k
in
locals
()
.
keys
()
if
not
k
.
endswith
(
'
_swigregister
'
)]
%
}
/*
%extend OpenMM::XmlSerializer {
%template(XmlSerializer_serialize_AndersenThermostat) XmlSerializer::serialize<AndersenThermostat>;
...
...
wrappers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
View file @
7ba1a10c
...
...
@@ -5,6 +5,7 @@ try:
except
:
pass
import
sys
import
math
RMIN_PER_SIGMA
=
math
.
pow
(
2
,
1
/
6.0
)
RVDW_PER_SIGMA
=
math
.
pow
(
2
,
1
/
6.0
)
/
2.0
...
...
@@ -273,14 +274,15 @@ def stripUnits(args):
"""
newArgList
=
[]
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
.
if
arg
.
unit
.
is_compatible
(
unit
.
bar
)
:
arg
=
arg
/
unit
.
bar
else
:
arg
=
arg
.
value_in_unit_system
(
unit
.
md_unit_system
)
#
JDC
:
End
workaround
.
#
arg
=
arg
.
value_in_unit_system
(
unit
.
md_unit_system
)
elif
isinstance
(
arg
,
dict
)
:
newKeys
=
stripUnits
(
arg
.
keys
())
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