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
4278a19d
Commit
4278a19d
authored
Jun 28, 2016
by
peastman
Committed by
GitHub
Jun 28, 2016
Browse files
Merge pull request #1524 from peastman/unitdocs
Added units classes to Python API docs
parents
c902f110
3b256326
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
docs-source/api-python/app.rst.jinja2
docs-source/api-python/app.rst.jinja2
+14
-0
docs-source/api-python/render.py
docs-source/api-python/render.py
+10
-1
No files found.
docs-source/api-python/app.rst.jinja2
View file @
4278a19d
...
...
@@ -21,6 +21,9 @@ Representation and Manipulation
:template: class.rst
~simtk.openmm.app.topology.Topology
~simtk.openmm.app.topology.Chain
~simtk.openmm.app.topology.Residue
~simtk.openmm.app.topology.Atom
~simtk.openmm.app.modeller.Modeller
Simulation
...
...
@@ -53,3 +56,14 @@ Extras
{% for extra in app_extras %}
~{{ extra }}
{% endfor %}
Units
~~~~~~
.. autosummary::
:toctree: generated/
:template: class.rst
:nosignatures:
{% for unit in units %}
~{{ unit }}
{% endfor %}
docs-source/api-python/render.py
View file @
4278a19d
...
...
@@ -32,6 +32,7 @@ def library_template_variables():
'integrators'
:
[],
'forces'
:
[],
'library_extras'
:
[],
'units'
:
[],
}
mm_klasses
=
inspect
.
getmembers
(
simtk
.
openmm
,
predicate
=
inspect
.
isclass
)
...
...
@@ -65,6 +66,11 @@ def library_template_variables():
if
full
not
in
exclude
and
not
klass
.
__name__
[
0
].
islower
():
data
[
'library_extras'
].
append
(
full
)
# gather units related classes
unit_klasses
=
inspect
.
getmembers
(
simtk
.
unit
,
predicate
=
inspect
.
isclass
)
for
name
,
klass
in
unit_klasses
:
data
[
'units'
].
append
(
fullname
(
klass
))
return
data
...
...
@@ -93,11 +99,14 @@ def app_template_variables():
# gather all classes with "File" in the name
for
name
,
klass
in
app_klasses
:
if
'File'
in
name
:
if
'File'
in
name
or
'CharmmParameterSet'
in
name
:
data
[
'fileclasses'
].
append
(
fullname
(
klass
))
# gather all extra subclasses in simtk.openmm.app
exclude
=
[
'simtk.openmm.app.topology.Topology'
,
'simtk.openmm.app.topology.Chain'
,
'simtk.openmm.app.topology.Residue'
,
'simtk.openmm.app.topology.Atom'
,
'simtk.openmm.app.modeller.Modeller'
,
'simtk.openmm.app.forcefield.ForceField'
,
'simtk.openmm.app.simulation.Simulation'
]
...
...
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