Skip to content

Commit

Permalink
Merge pull request #28 from materials-data-facility/forge-dev
Browse files Browse the repository at this point in the history
Add docs on Read the Docs, other improvements
  • Loading branch information
jgaff authored Jun 4, 2018
2 parents ddd18c4 + 1438e85 commit b15ef99
Show file tree
Hide file tree
Showing 20 changed files with 1,019 additions and 404 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ Untitled*.ipynb
*.egg*

travis.tar
.coverage
.coverage*

6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ python:
- '3.6'
install:
- pip install -e .
- pip install pytest pytest-cov coveralls flake8
- pip install -r test_requirements.txt
env:
- TEST_ENV=travis
script:
- flake8 . && travis_wait 50 py.test
- if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then flake8 . && travis_wait 50 py.test;
else flake8 . && travis_wait 50 py.test --nbval-lax; fi;
#- flake8 . && travis_wait 50 py.test --nbval-lax
before_install:
- openssl aes-256-cbc -K $encrypted_39a50b90a369_key -iv $encrypted_39a50b90a369_iv
-in travis.tar.enc -out travis.tar -d
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Forge
[![PyPI](https://img.shields.io/pypi/v/mdf_forge.svg)](https://pypi.python.org/pypi/mdf-forge) [![Build Status](https://travis-ci.org/materials-data-facility/forge.svg?branch=master)](https://travis-ci.org/materials-data-facility/forge) [![Coverage Status](https://coveralls.io/repos/github/materials-data-facility/forge/badge.svg?branch=master)](https://coveralls.io/github/materials-data-facility/forge?branch=master)
[![PyPI](https://img.shields.io/pypi/v/mdf_forge.svg)](https://pypi.python.org/pypi/mdf-forge) [![Build Status](https://travis-ci.org/materials-data-facility/forge.svg?branch=master)](https://travis-ci.org/materials-data-facility/forge) [![Coverage Status](https://coveralls.io/repos/github/materials-data-facility/forge/badge.svg?branch=master)](https://coveralls.io/github/materials-data-facility/forge?branch=master) [![Read the Docs](https://readthedocs.org/projects/mdf-forge/badge/?version=master)](http://mdf-forge.readthedocs.io/en/master/)

Forge is the Materials Data Facility Python package to interface and leverage the MDF Data Discovery service. Forge allows users to perform simple queries and facilitiates moving and synthesizing results.

Expand All @@ -17,10 +17,12 @@ pip install -e .
```

# Documentation and examples
Documentation, including tutorials and examples, can be found in the `docs` directory.
Forge documentation can be found on [Read the Docs](http://mdf-forge.readthedocs.io/en/master/).
Tutorials and examples can be found in the `docs` directory. The Jupyter notebooks can be viewed on GitHub or run interactively with ![Jupyter](http://jupyter.org/install).

# Requirements
* Forge requires Python 2.7 or >=3.3
* Forge requires Python 3.4 or greater.
* **Note**: Python 2.7 support has been deprecated. Forge releases after version 0.6.2 will not work in Python 2. Please upgrade to Python 3.
* To access data in the MDF, you must have an account recognized by Globus Auth (including Google, ORCiD, many academic institutions, or a [free Globus ID](https://www.globusid.org/create)).

# Contributions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,25 +87,19 @@
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"The MDF stores multiple versions of the OQMD metadata. First, we need to get the latest version"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Latest version: 9\n"
]
}
],
"outputs": [],
"source": [
"oqmd_version = mdf.get_dataset_version('oqmd')\n",
"print('Latest version: {}'.format(oqmd_version))"
Expand All @@ -119,18 +113,8 @@
]
},
{
"cell_type": "code",
"execution_count": 5,
"cell_type": "markdown",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Found 4897 compounds\n"
]
}
],
"source": [
"query_string = 'mdf.source_name:oqmd_v{0} AND (oqmd_v{0}.configuration:static '\\\n",
" 'OR oqmd_v{0}.configuration:standard) AND dft.converged:True'.format(oqmd_version)\n",
Expand Down Expand Up @@ -726,12 +710,10 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
Expand Down
20 changes: 20 additions & 0 deletions docs/sphinx/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = mdf-forge
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)
224 changes: 224 additions & 0 deletions docs/sphinx/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
# -*- 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('..'))
sys.path.insert(0, os.path.abspath('../../..'))
sys.path.insert(0, os.path.abspath('../../../mdf_forge'))
sys.path.insert(0, os.path.abspath('../../../tests'))

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

project = 'MDF Forge'
copyright = 'Apache License, Version 2.0'
author = 'Jonathon Gaff'

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


# -- 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.intersphinx',
'sphinx.ext.ifconfig',
'sphinx.ext.napoleon',
'sphinx.ext.mathjax',
'IPython.sphinxext.ipython_console_highlighting',
]

# 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']
#
# Using Sphinx with Markdown
# https://github.com/serra/sphinx-with-markdown


# Use Markdown and reStructuredText in the same Sphinx project.
# from recommonmark.parser import CommonMarkParser

# source_parsers = {
# '.md': CommonMarkParser,
# }

source_suffix = ['.rst', '.md']

# 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', '**.ipynb_checkpoints']

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

# A list of modules to be mocked up. This is useful when some external dependencies are not met
# at build time and break the building process.
# You may only specify the root package of the dependencies themselves and ommit the sub-modules:
# See also:
# http://www.sphinx-doc.org/en/stable/ext/autodoc.html#confval-autodoc_mock_importshttps://github.com/sphinx-doc/sphinx/issues/4182
autodoc_mock_imports = ['mdf_toolbox', 'pytest', 'globus_sdk.exc']

# This value selects what content will be inserted into the main body of an autoclass directive.
# The possible values are:
# “class ”: Only the class ’ docstring is inserted. This is the default.
# You “can still document init as a separate method using automethod or “the members option
# to autoclass.
# “both”: Both the class ’ and the init method’s docstring are concatenated and inserted.
# “init”: Only the init method’s docstring is inserted.
autoclass_content = 'both'

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

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
# List of themes: basic, alabaster, classic, sphinxdoc, scrolls, agoago, nature,
# pyramid, haiku, traditional, epub, bizstyle
#
html_theme = 'sphinxdoc'

# 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 = 'mdf-forgedoc'


# -- 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, 'mdf-forge.tex', u'mdf-forge Documentation',
'Jonathon Gaff', '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, 'mdf-forge', u'mdf-forge Documentation',
[author], 1)
]

# If true, show URL addresses after external links.
# man_show_urls = False

# -- 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, 'mdf-forge', u'mdf-forge Documentation',
author, 'mdf-forge', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
# texinfo_appendices = []

# If false, no module index is generated.
# texinfo_domain_indices = True

# How to display URL addresses: 'footnote', 'no', or 'inline'.
# texinfo_show_urls = 'footnote'

# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False

# -- Extension configuration -------------------------------------------------
# Napoleon settings
# see http://www.sphinx-doc.org/en/stable/ext/napoleon.html
napoleon_google_docstring = True
napoleon_numpy_docstring = True
napoleon_include_init_with_doc = False
napoleon_include_private_with_doc = False
napoleon_include_special_with_doc = True
napoleon_use_admonition_for_examples = False
napoleon_use_admonition_for_notes = True
napoleon_use_admonition_for_references = False
napoleon_use_ivar = False
napoleon_use_param = True
napoleon_use_rtype = True

# -- Options for intersphinx extension ---------------------------------------

# Example configuration for inter sphinx: refer to the Python standard library.
# intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
Loading

0 comments on commit b15ef99

Please sign in to comment.