Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formalizing the Schema #37

Merged
merged 19 commits into from
Mar 30, 2018
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
Expand Down Expand Up @@ -99,3 +100,6 @@ ENV/

# mypy
.mypy_cache/

# Dev schema
docs/source/auto*rst
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# After changing this file, check it on:
# http://lint.travis-ci.org/
language: python

# Run jobs on container-based infrastructure, can be overridden per job
sudo: false

matrix:
include:
- python: 2.7
- python: 3.5

before_install:
- uname -a
- free -m
- df -h
- ulimit -a
- python -V
- pip install --upgrade pip setuptools
- pip install pytest jsonschema
- pip install -e .

script:
- make test

after_success:
- make docs

notifications:
email: false
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.PHONY: install
install:
pip install -e .

.PHONY: test
test:
pytest -v

.PHONY: docs
docs:
cd docs && make html
12 changes: 6 additions & 6 deletions Topology/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ should likely be handled by a higher level driver and not make the spec more dif

The following molecule specification is used. The required fields are:

- `symbols` (list) - A list of strings
- `symbols` (list) - A list of strings
- `geometry` (list) - A 3N XYZ coordinate list of list in bohr, will likely change to encompass decided unit specifications

The following are optional fields and default values (option, more a list of possibilities QM programs would want):
Expand All @@ -23,15 +23,15 @@ The following are optional fields and default values (option, more a list of pos
- `comment` (str) - Any additional comment one would attach to the molecule.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, based on #35 that it makes sense to have an "identifier" section, with comment, molecule name, formula, InChI, SMILES, etc. as optional. This would probably also include provenance and DOI.

Looking at my notes, I think these were grouped in the discussion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you thinking of comment as a dictionary? I was considering moving up a few of those to top level optional fields.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I'm thinking that there's an obvious request for identifiers, and I think comment/title have usually been identifiers in QC codes.

So my suggestion is that there's an explicit identifier object - something like:

"identifier" : {
   "name": "aspirin",
   "comment": "training set",
   "formula": "C9H8O4",
   "smiles": "O=C(C)Oc1ccccc1C(=O)O",
   "inchikey": "BSYNRYMUTXBXSQ-UHFFFAOYSA-N"
}

- `fragments` (list of tuples, `[]`) - A list of indices (0-indexed) for molecular fragments within the topology.
- `fragment_charges` (list of floats, `[]`) - A list of charges associated with the fragments tuple.
- `fragment_multiplicities` (list of ints, `[]`) - A list of multiplicites associated with each fragment.
- `fragment_multiplicities` (list of ints, `[]`) - A list of multiplicites associated with each fragment.
- `fix_com` (bool) - whether to adjust to the molecule to the COM or not
- `fix_orientation` (bool) - whether to rotate the molecule to a standard orientation or not
- `provenance` (dict, `{}`) - The provencance of the molecule.
- `doi` - A doi reference for the molecule.

Other possible quantities:
- Bonds - Holding data for MM computations
- Basis Sets per atom
- `fix_com` (bool) - whether to adjust to the molecule to the COM or not
- `fix_orientation` (bool) - whether to rotate the molecule to a standard orientation or not
- Basis Sets per atom
- label (list of str) - Per-atom labels which may be seperate from fragments
- Extend the `real` quantitity to cover real, ghost, absent, qm/mm region, etc.
- EFP quantities `fragment_types`, `coordinate_hints`. This is an example and likely not part of the spec. How would we handle this?
- EFP quantities `fragment_types`, `coordinate_hints`. This is an example and likely not part of the spec. How would we handle this?
21 changes: 21 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = qc_schema
SOURCEDIR = source
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

16 changes: 16 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Compiling QC_JSON_Schema's Documentation

The docs for this project are built with [Sphinx](http://www.sphinx-doc.org/en/master/).
To compile the docs, first ensure that Sphinx and the ReadTheDocs theme are installed.

```bash
pip install sphinx sphinx_rtd_theme
```

Once installed, you can use the `Makefile` in this directory to compile static HTML pages by
```bash
make html
```

The compiled docs will be in the `_build` directory and can be viewed by opening `index.html` (which may itself
be inside a directory called `html/` depending on what version of Sphinx is installed).
36 changes: 36 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=_build
set SPHINXPROJ=qc_schema

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

:end
popd
166 changes: 166 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/stable/config

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

# Super hacky auto gen
import sys
import os
sys.path.insert(1, os.path.dirname(__file__))
import gen_schema_docs

project = 'A schema for Quantum Chemistry'
copyright = "2018, The Molecular Sciences Software Institute"
author = 'The Molecular Sciences Software Institute'

# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = ''


# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.mathjax',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}


# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'QC_JSON_Schemadoc'


# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'QC_JSON_Schema.tex', 'QC_JSON_Schema Documentation',
'QC_JSON_Schema', 'manual'),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'QC_JSON_Schema', 'QC_JSON_Schema Documentation',
[author], 1)
]


# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'QC_JSON_Schema', 'QC_JSON_Schema Documentation',
author, 'QC_JSON_Schema', 'A schema for Quantum Chemistry',
'Miscellaneous'),
]


# -- Extension configuration -------------------------------------------------