Commit 4d55c9ee authored by Robert McGibbon's avatar Robert McGibbon
Browse files

Autogenerate more, and switch themes

parent f42dd867
...@@ -7,16 +7,9 @@ Loaders and Setup ...@@ -7,16 +7,9 @@ Loaders and Setup
:toctree: generated/ :toctree: generated/
:template: class.rst :template: class.rst
~simtk.openmm.app.pdbfile.PDBFile {% for fileclass in fileclasses %}
~simtk.openmm.app.pdbxfile.PDBxFile ~{{ fileclass }}
~simtk.openmm.app.gromacsgrofile.GromacsGroFile {% endfor %}
~simtk.openmm.app.gromacstopfile.GromacsTopFile
~simtk.openmm.app.amberinpcrdfile.AmberInpcrdFile
~simtk.openmm.app.amberprmtopfile.AmberPrmtopFile
~simtk.openmm.app.charmmpsffile.CharmmPsfFile
~simtk.openmm.app.charmmcrdfiles.CharmmRstFile
~simtk.openmm.app.charmmparameterset.CharmmParameterSet
~simtk.openmm.app.desmonddmsfile.DesmondDMSFile
Representation and Manipulation Representation and Manipulation
...@@ -47,4 +40,14 @@ Reporting Output ...@@ -47,4 +40,14 @@ Reporting Output
{% for reporter in reporters %} {% for reporter in reporters %}
~{{ reporter }} ~{{ reporter }}
{% endfor %} {% endfor %}
~simtk.openmm.app.dcdfile.DCDFile
Extras
~~~~~~
.. autosummary::
:toctree: generated/
:template: class.rst
{% for extra in app_extras %}
~{{ extra }}
{% endfor %}
...@@ -44,14 +44,15 @@ pygments_style = 'sphinx' ...@@ -44,14 +44,15 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
html_theme = "alabaster" html_theme = "sphinx_rtd_theme"
html_theme_options = { html_theme_options = {
'logo': 'OPENMMLogo.png', # 'logo': 'OPENMMLogo.png',
'description': 'A high performance GPU molecular simulation toolkit', #'description': 'A high performance GPU molecular simulation toolkit',
'github_user': 'pandegroup', #'github_user': 'pandegroup',
'github_repo': 'openmm', #'github_repo': 'openmm',
'travis_button': True, #'travis_button': True,
} }
html_logo = 'OPENMMLogo.png'
# Add any paths that contain custom themes here, relative to this directory. # Add any paths that contain custom themes here, relative to this directory.
......
...@@ -11,6 +11,7 @@ Core Objects ...@@ -11,6 +11,7 @@ Core Objects
~simtk.openmm.openmm.System ~simtk.openmm.openmm.System
~simtk.openmm.openmm.Context ~simtk.openmm.openmm.Context
~simtk.openmm.openmm.Platform ~simtk.openmm.openmm.Platform
~simtk.openmm.openmm.State
Forces Forces
......
...@@ -10,23 +10,19 @@ def fullname(klass): ...@@ -10,23 +10,19 @@ def fullname(klass):
return klass.__module__ + '.' + klass.__name__ return klass.__module__ + '.' + klass.__name__
def template_variables(): # 'integrators': [],
# 'library_extras': [],
# 'forces': [],
def library_template_variables():
data = { data = {
'reporters': [],
'forces': [],
'integrators': [], 'integrators': [],
'library_extras': [] 'library_extras': [],
'forces': [],
} }
app_klasses = inspect.getmembers(app, predicate=inspect.isclass)
mm_klasses = inspect.getmembers(mm, predicate=inspect.isclass) mm_klasses = inspect.getmembers(mm, predicate=inspect.isclass)
# gather all Reporters
for name, klass in app_klasses:
if name.endswith('Reporter'):
data['reporters'].append(fullname(klass))
# gather all Force subclasses # gather all Force subclasses
for name, klass in mm_klasses: for name, klass in mm_klasses:
if issubclass(klass, mm.Force): if issubclass(klass, mm.Force):
...@@ -37,23 +33,54 @@ def template_variables(): ...@@ -37,23 +33,54 @@ def template_variables():
if issubclass(klass, mm.Integrator): if issubclass(klass, mm.Integrator):
data['integrators'].append(fullname(klass)) data['integrators'].append(fullname(klass))
# gather all extra subclasses # gather all extra subclasses in simtk.openmm.openmm
exclude = ['simtk.openmm.openmm.Platform', 'simtk.openmm.openmm.Context',
'simtk.openmm.openmm.System', 'simtk.openmm.openmm.State']
exclude.extend(data['forces'])
exclude.extend(data['integrators'])
exclude.extend([
'simtk.openmm.openmm.SwigPyIterator',
'simtk.openmm.openmm.OpenMMException'])
for _, klass in mm_klasses: for _, klass in mm_klasses:
full = fullname(klass) full = fullname(klass)
if full not in exclude and not klass.__name__[0].islower():
data['library_extras'].append(full)
if full in data['forces']: return data
continue
if full in data['integrators']:
continue
if full in ('simtk.openmm.openmm.Platform', 'simtk.openmm.openmm.Context',
'simtk.openmm.openmm.System'):
continue
if klass.__name__[0].islower():
continue
if klass.__name__ in ['SwigPyIterator', 'OpenMMException']:
continue
data['library_extras'].append(full)
def app_template_variables():
data = {
'reporters': [],
'fileclasses': [],
'app_extras': [],
}
app_klasses = inspect.getmembers(app, predicate=inspect.isclass)
# gather all Reporters
for name, klass in app_klasses:
if name.endswith('Reporter'):
data['reporters'].append(fullname(klass))
# gather all classes with "File" in the name
for name, klass in app_klasses:
if 'File' in name:
data['fileclasses'].append(fullname(klass))
# gather all extra subclasses in simtk.openmm.app
exclude = ['simtk.openmm.app.topology.Topology',
'simtk.openmm.app.modeller.Modeller',
'simtk.openmm.app.forcefield.ForceField',
'simtk.openmm.app.simulation.Simulation']
exclude.extend(data['reporters'])
exclude.extend(data['fileclasses'])
for _, klass in app_klasses:
full = fullname(klass)
if full not in exclude and not klass.__name__[0].islower():
data['app_extras'].append(full)
return data return data
...@@ -62,7 +89,8 @@ def main(): ...@@ -62,7 +89,8 @@ def main():
here = dirname(__file__) here = dirname(__file__)
templateLoader = jinja2.FileSystemLoader(here) templateLoader = jinja2.FileSystemLoader(here)
templateEnv = jinja2.Environment(loader=templateLoader) templateEnv = jinja2.Environment(loader=templateLoader)
data = template_variables() data = library_template_variables()
data.update(app_template_variables())
for template_fn in glob(join(here, '*.jinja2')): for template_fn in glob(join(here, '*.jinja2')):
output_fn = splitext(template_fn)[0] output_fn = splitext(template_fn)[0]
......
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