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
a51caf73
Commit
a51caf73
authored
Jan 05, 2017
by
peastman
Committed by
GitHub
Jan 05, 2017
Browse files
Merge pull request #1709 from peastman/deprecated
Fixed deprecation warnings in Python API docs
parents
67450563
8eedf2be
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
8 deletions
+16
-8
docs-source/api-python/process-docstring.py
docs-source/api-python/process-docstring.py
+8
-4
wrappers/python/simtk/openmm/app/modeller.py
wrappers/python/simtk/openmm/app/modeller.py
+1
-2
wrappers/python/src/swig_doxygen/swigInputBuilder.py
wrappers/python/src/swig_doxygen/swigInputBuilder.py
+5
-0
wrappers/python/src/swig_doxygen/swig_lib/python/extend.i
wrappers/python/src/swig_doxygen/swig_lib/python/extend.i
+2
-2
No files found.
docs-source/api-python/process-docstring.py
View file @
a51caf73
...
@@ -2,7 +2,7 @@ import re
...
@@ -2,7 +2,7 @@ import re
def
process_docstring
(
app
,
what
,
name
,
obj
,
options
,
lines
):
def
process_docstring
(
app
,
what
,
name
,
obj
,
options
,
lines
):
"""This hook edits the docstrings to replace "<tt><pre>" html tags
"""This hook edits the docstrings to replace "<tt><pre>" html tags
with sphinx directives.
and deprecated markers
with sphinx directives.
"""
"""
def
repl
(
m
):
def
repl
(
m
):
s
=
m
.
group
(
1
)
s
=
m
.
group
(
1
)
...
@@ -10,15 +10,19 @@ def process_docstring(app, what, name, obj, options, lines):
...
@@ -10,15 +10,19 @@ def process_docstring(app, what, name, obj, options, lines):
s
=
linesep
+
s
s
=
linesep
+
s
newline
=
'.. code-block:: c++'
+
linesep
newline
=
'.. code-block:: c++'
+
linesep
return
newline
+
' '
+
s
.
replace
(
linesep
,
linesep
+
' '
)
return
newline
+
' '
+
s
.
replace
(
linesep
,
linesep
+
' '
)
def
repl2
(
m
):
if
name
==
'simtk.openmm.openmm.CustomTorsionForce'
:
s
=
m
.
group
(
1
)
print
(
lines
)
if
not
s
.
startswith
(
linesep
):
s
=
linesep
+
s
newline
=
'|LINEBREAK|.. admonition:: Deprecated'
+
linesep
return
newline
+
' '
+
s
.
replace
(
linesep
,
linesep
+
' '
)
linesep
=
'|LINEBREAK|'
linesep
=
'|LINEBREAK|'
joined
=
linesep
.
join
(
lines
)
joined
=
linesep
.
join
(
lines
)
joined
=
re
.
sub
(
r
'<tt><pre>((|LINEBREAK|)?.*?)</pre></tt>'
,
repl
,
joined
)
joined
=
re
.
sub
(
r
'<tt><pre>((|LINEBREAK|)?.*?)</pre></tt>'
,
repl
,
joined
)
joined
=
re
.
sub
(
r
'<tt>(.*?)</tt>'
,
repl
,
joined
)
joined
=
re
.
sub
(
r
'<tt>(.*?)</tt>'
,
repl
,
joined
)
joined
=
re
.
sub
(
r
'@deprecated(.*?\|LINEBREAK\|)'
,
repl2
,
joined
,
flags
=
re
.
IGNORECASE
)
lines
[:]
=
[(
l
if
not
l
.
isspace
()
else
''
)
for
l
in
joined
.
split
(
linesep
)]
lines
[:]
=
[(
l
if
not
l
.
isspace
()
else
''
)
for
l
in
joined
.
split
(
linesep
)]
...
...
wrappers/python/simtk/openmm/app/modeller.py
View file @
a51caf73
...
@@ -186,8 +186,7 @@ class Modeller(object):
...
@@ -186,8 +186,7 @@ class Modeller(object):
def
convertWater
(
self
,
model
=
'tip3p'
):
def
convertWater
(
self
,
model
=
'tip3p'
):
"""Convert all water molecules to a different water model.
"""Convert all water molecules to a different water model.
@deprecated Use addExtraParticles() instead. It performs the same
@deprecated Use addExtraParticles() instead. It performs the same function but in a more general way.
function but in a more general way.
Parameters
Parameters
----------
----------
...
...
wrappers/python/src/swig_doxygen/swigInputBuilder.py
View file @
a51caf73
...
@@ -74,6 +74,11 @@ def getNodeText(node):
...
@@ -74,6 +74,11 @@ def getNodeText(node):
s
=
"%s%s
\n\n
"
%
(
s
,
getNodeText
(
n
))
s
=
"%s%s
\n\n
"
%
(
s
,
getNodeText
(
n
))
elif
n
.
tag
==
"ref"
:
elif
n
.
tag
==
"ref"
:
s
=
"%s%s"
%
(
s
,
getNodeText
(
n
))
s
=
"%s%s"
%
(
s
,
getNodeText
(
n
))
elif
n
.
tag
==
"xrefsect"
:
title
=
n
.
find
(
"xreftitle"
)
description
=
n
.
find
(
"xrefdescription"
)
if
title
is
not
None
and
description
is
not
None
and
getNodeText
(
title
).
lower
()
==
"deprecated"
:
s
=
"%s
\n
@deprecated %s
\n\n
"
%
(
s
,
getNodeText
(
description
))
else
:
else
:
if
n
.
tag
in
docTags
:
if
n
.
tag
in
docTags
:
tag
=
docTags
[
n
.
tag
]
tag
=
docTags
[
n
.
tag
]
...
...
wrappers/python/src/swig_doxygen/swig_lib/python/extend.i
View file @
a51caf73
...
@@ -322,14 +322,14 @@ Parameters:
...
@@ -322,14 +322,14 @@ Parameters:
}
}
%
extend
OpenMM
::
XmlSerializer
{
%
extend
OpenMM
::
XmlSerializer
{
%
feature
(
docstring
,
"This method exists only for backward compatibility.
@deprecated Use serialize() instead."
)
serializeSystem
;
%
feature
(
docstring
,
"This method exists only for backward compatibility.
\n
@deprecated Use serialize() instead."
)
serializeSystem
;
static
std
::
string
serializeSystem
(
const
OpenMM
::
System
*
object
)
{
static
std
::
string
serializeSystem
(
const
OpenMM
::
System
*
object
)
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
OpenMM
::
XmlSerializer
::
serialize
<
OpenMM
::
System
>
(
object
,
"System"
,
ss
)
;
OpenMM
::
XmlSerializer
::
serialize
<
OpenMM
::
System
>
(
object
,
"System"
,
ss
)
;
return
ss
.
str
()
;
return
ss
.
str
()
;
}
}
%
feature
(
docstring
,
"This method exists only for backward compatibility.
@deprecated Use deserialize() instead."
)
deserializeSystem
;
%
feature
(
docstring
,
"This method exists only for backward compatibility.
\n
@deprecated Use deserialize() instead."
)
deserializeSystem
;
%
newobject
deserializeSystem
;
%
newobject
deserializeSystem
;
static
OpenMM
::
System
*
deserializeSystem
(
const
char
*
inputString
)
{
static
OpenMM
::
System
*
deserializeSystem
(
const
char
*
inputString
)
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
...
...
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