Commit 4278a19d authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #1524 from peastman/unitdocs

Added units classes to Python API docs
parents c902f110 3b256326
...@@ -21,6 +21,9 @@ Representation and Manipulation ...@@ -21,6 +21,9 @@ Representation and Manipulation
:template: class.rst :template: class.rst
~simtk.openmm.app.topology.Topology ~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.modeller.Modeller
Simulation Simulation
...@@ -53,3 +56,14 @@ Extras ...@@ -53,3 +56,14 @@ Extras
{% for extra in app_extras %} {% for extra in app_extras %}
~{{ extra }} ~{{ extra }}
{% endfor %} {% endfor %}
Units
~~~~~~
.. autosummary::
:toctree: generated/
:template: class.rst
:nosignatures:
{% for unit in units %}
~{{ unit }}
{% endfor %}
...@@ -32,6 +32,7 @@ def library_template_variables(): ...@@ -32,6 +32,7 @@ def library_template_variables():
'integrators': [], 'integrators': [],
'forces': [], 'forces': [],
'library_extras': [], 'library_extras': [],
'units': [],
} }
mm_klasses = inspect.getmembers(simtk.openmm, predicate=inspect.isclass) mm_klasses = inspect.getmembers(simtk.openmm, predicate=inspect.isclass)
...@@ -65,6 +66,11 @@ def library_template_variables(): ...@@ -65,6 +66,11 @@ def library_template_variables():
if full not in exclude and not klass.__name__[0].islower(): if full not in exclude and not klass.__name__[0].islower():
data['library_extras'].append(full) 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 return data
...@@ -93,11 +99,14 @@ def app_template_variables(): ...@@ -93,11 +99,14 @@ def app_template_variables():
# gather all classes with "File" in the name # gather all classes with "File" in the name
for name, klass in app_klasses: for name, klass in app_klasses:
if 'File' in name: if 'File' in name or 'CharmmParameterSet' in name:
data['fileclasses'].append(fullname(klass)) data['fileclasses'].append(fullname(klass))
# gather all extra subclasses in simtk.openmm.app # gather all extra subclasses in simtk.openmm.app
exclude = ['simtk.openmm.app.topology.Topology', 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.modeller.Modeller',
'simtk.openmm.app.forcefield.ForceField', 'simtk.openmm.app.forcefield.ForceField',
'simtk.openmm.app.simulation.Simulation'] 'simtk.openmm.app.simulation.Simulation']
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment