From c5c27559e6253b3863fe4bd59aa86e65b52ecc78 Mon Sep 17 00:00:00 2001
From: jlstevens
Date: Tue, 12 Apr 2016 14:03:20 +0100
Subject: [PATCH 01/15] Initialized doc directory with sphinx-quickstart
---
doc/Makefile | 216 +++++++++++++++++++++++++++++
doc/conf.py | 366 ++++++++++++++++++++++++++++++++++++++++++++++++++
doc/index.rst | 22 +++
3 files changed, 604 insertions(+)
create mode 100644 doc/Makefile
create mode 100644 doc/conf.py
create mode 100644 doc/index.rst
diff --git a/doc/Makefile b/doc/Makefile
new file mode 100644
index 0000000..4e0c1b0
--- /dev/null
+++ b/doc/Makefile
@@ -0,0 +1,216 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = _build
+
+# User-friendly check for sphinx-build
+ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
+$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
+endif
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help
+help:
+ @echo "Please use \`make ' where is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " applehelp to make an Apple Help Book"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " texinfo to make Texinfo files"
+ @echo " info to make Texinfo files and run them through makeinfo"
+ @echo " gettext to make PO message catalogs"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " xml to make Docutils-native XML files"
+ @echo " pseudoxml to make pseudoxml-XML files for display purposes"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+ @echo " coverage to run coverage check of the documentation (if enabled)"
+
+.PHONY: clean
+clean:
+ rm -rf $(BUILDDIR)/*
+
+.PHONY: html
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+.PHONY: dirhtml
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+.PHONY: singlehtml
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+.PHONY: pickle
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+.PHONY: json
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+.PHONY: htmlhelp
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+.PHONY: qthelp
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/CubeExplorer.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/CubeExplorer.qhc"
+
+.PHONY: applehelp
+applehelp:
+ $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
+ @echo
+ @echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
+ @echo "N.B. You won't be able to view it unless you put it in" \
+ "~/Library/Documentation/Help or install it in your application" \
+ "bundle."
+
+.PHONY: devhelp
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/CubeExplorer"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/CubeExplorer"
+ @echo "# devhelp"
+
+.PHONY: epub
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+.PHONY: latex
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+.PHONY: latexpdf
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+.PHONY: latexpdfja
+latexpdfja:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through platex and dvipdfmx..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+.PHONY: text
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+.PHONY: man
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+.PHONY: texinfo
+texinfo:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo
+ @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+ @echo "Run \`make' in that directory to run these through makeinfo" \
+ "(use \`make info' here to do that automatically)."
+
+.PHONY: info
+info:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo "Running Texinfo files through makeinfo..."
+ make -C $(BUILDDIR)/texinfo info
+ @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+.PHONY: gettext
+gettext:
+ $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+ @echo
+ @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+.PHONY: changes
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+.PHONY: linkcheck
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+.PHONY: doctest
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
+
+.PHONY: coverage
+coverage:
+ $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
+ @echo "Testing of coverage in the sources finished, look at the " \
+ "results in $(BUILDDIR)/coverage/python.txt."
+
+.PHONY: xml
+xml:
+ $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
+ @echo
+ @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
+
+.PHONY: pseudoxml
+pseudoxml:
+ $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
+ @echo
+ @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
diff --git a/doc/conf.py b/doc/conf.py
new file mode 100644
index 0000000..5b6e832
--- /dev/null
+++ b/doc/conf.py
@@ -0,0 +1,366 @@
+# -*- coding: utf-8 -*-
+#
+# CubeExplorer documentation build configuration file, created by
+# sphinx-quickstart on Tue Apr 12 14:07:39 2016.
+#
+# This file is execfile()d with the current directory set to its
+# containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys
+import os
+
+# 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.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- 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.doctest',
+ 'sphinx.ext.intersphinx',
+ 'sphinx.ext.todo',
+ 'sphinx.ext.coverage',
+ 'sphinx.ext.mathjax',
+ 'sphinx.ext.ifconfig',
+ 'sphinx.ext.viewcode',
+]
+
+# 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 encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'CubeExplorer'
+copyright = u'2016, CubeExplorer developers'
+author = u'CubeExplorer developers'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = u'v0.1'
+# The full version, including alpha/beta/rc tags.
+release = u'v0.1'
+
+# 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
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+# If true, keep warnings as "system message" paragraphs in the built documents.
+#keep_warnings = False
+
+# If true, `todo` and `todoList` produce output, else they produce nothing.
+todo_include_todos = True
+
+
+# -- 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 = 'alabaster'
+
+# 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 themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# " v documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# 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']
+
+# Add any extra paths that contain custom files (such as robots.txt or
+# .htaccess) here, relative to this directory. These files are copied
+# directly to the root of the documentation.
+#html_extra_path = []
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Language to be used for generating the HTML full-text search index.
+# Sphinx supports the following languages:
+# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
+# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
+#html_search_language = 'en'
+
+# A dictionary with options for the search language support, empty by default.
+# Now only 'ja' uses this config value
+#html_search_options = {'type': 'default'}
+
+# The name of a javascript file (relative to the configuration directory) that
+# implements a search results scorer. If empty, the default will be used.
+#html_search_scorer = 'scorer.js'
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'CubeExplorerdoc'
+
+# -- 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, 'CubeExplorer.tex', u'CubeExplorer Documentation',
+ u'CubeExplorer developers', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- 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, 'cubeexplorer', u'CubeExplorer 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, 'CubeExplorer', u'CubeExplorer Documentation',
+ author, 'CubeExplorer', '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
+
+
+# -- Options for Epub output ----------------------------------------------
+
+# Bibliographic Dublin Core info.
+epub_title = project
+epub_author = author
+epub_publisher = author
+epub_copyright = copyright
+
+# The basename for the epub file. It defaults to the project name.
+#epub_basename = project
+
+# The HTML theme for the epub output. Since the default themes are not
+# optimized for small screen space, using the same theme for HTML and epub
+# output is usually not wise. This defaults to 'epub', a theme designed to save
+# visual space.
+#epub_theme = 'epub'
+
+# The language of the text. It defaults to the language option
+# or 'en' if the language is not set.
+#epub_language = ''
+
+# The scheme of the identifier. Typical schemes are ISBN or URL.
+#epub_scheme = ''
+
+# The unique identifier of the text. This can be a ISBN number
+# or the project homepage.
+#epub_identifier = ''
+
+# A unique identification for the text.
+#epub_uid = ''
+
+# A tuple containing the cover image and cover page html template filenames.
+#epub_cover = ()
+
+# A sequence of (type, uri, title) tuples for the guide element of content.opf.
+#epub_guide = ()
+
+# HTML files that should be inserted before the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_pre_files = []
+
+# HTML files that should be inserted after the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_post_files = []
+
+# A list of files that should not be packed into the epub file.
+epub_exclude_files = ['search.html']
+
+# The depth of the table of contents in toc.ncx.
+#epub_tocdepth = 3
+
+# Allow duplicate toc entries.
+#epub_tocdup = True
+
+# Choose between 'default' and 'includehidden'.
+#epub_tocscope = 'default'
+
+# Fix unsupported image types using the Pillow.
+#epub_fix_images = False
+
+# Scale large images.
+#epub_max_image_width = 0
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#epub_show_urls = 'inline'
+
+# If false, no index is generated.
+#epub_use_index = True
+
+
+# Example configuration for intersphinx: refer to the Python standard library.
+intersphinx_mapping = {'https://docs.python.org/': None}
diff --git a/doc/index.rst b/doc/index.rst
new file mode 100644
index 0000000..6599c3a
--- /dev/null
+++ b/doc/index.rst
@@ -0,0 +1,22 @@
+.. CubeExplorer documentation master file, created by
+ sphinx-quickstart on Tue Apr 12 14:07:39 2016.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+Welcome to CubeExplorer's documentation!
+========================================
+
+Contents:
+
+.. toctree::
+ :maxdepth: 2
+
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
From 38786ef2636f4edbf1775124070cda5c2613b43a Mon Sep 17 00:00:00 2001
From: jlstevens
Date: Tue, 12 Apr 2016 14:17:56 +0100
Subject: [PATCH 02/15] Added sphinx build directory to .gitignore
---
.gitignore | 3 +++
1 file changed, 3 insertions(+)
diff --git a/.gitignore b/.gitignore
index e275bff..fcbebe3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -67,3 +67,6 @@ target/
# pyenv
.python-version
+
+# Website
+doc/_build
From 106e13028791e8d9b020f952476a5dd7cbb78fdf Mon Sep 17 00:00:00 2001
From: jlstevens
Date: Tue, 12 Apr 2016 14:35:50 +0100
Subject: [PATCH 03/15] Ignoring /doc directory when running flake8
---
.travis.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.travis.yml b/.travis.yml
index 08b4547..2366a06 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -32,6 +32,6 @@ install:
script:
- nosetests --with-doctest --with-coverage --cover-package=holocube
- - flake8 --ignore=E,W .
+ - flake8 --ignore=E,W . --exclude=./doc
after_success: coveralls
From cec4432604feaeb407fefcf7420ebc2fb5146b74 Mon Sep 17 00:00:00 2001
From: jlstevens
Date: Sun, 17 Apr 2016 11:55:13 +0100
Subject: [PATCH 04/15] Added nbpublisher and docbuilder submodules
---
.gitmodules | 8 ++++++++
doc/builder | 1 +
doc/nbpublisher | 1 +
3 files changed, 10 insertions(+)
create mode 100644 .gitmodules
create mode 160000 doc/builder
create mode 160000 doc/nbpublisher
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..c60470f
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,8 @@
+[submodule "doc/nbpublisher"]
+ path = doc/nbpublisher
+ url = https://github.com/ioam/ioam-builder.git
+ branch = nbpublisher
+[submodule "doc/builder"]
+ path = doc/builder
+ url = https://github.com/ioam/ioam-builder.git
+ branch = docbuilder
diff --git a/doc/builder b/doc/builder
new file mode 160000
index 0000000..fe584ca
--- /dev/null
+++ b/doc/builder
@@ -0,0 +1 @@
+Subproject commit fe584ca37d850315c21fa9e7602f56213c7a48ca
diff --git a/doc/nbpublisher b/doc/nbpublisher
new file mode 160000
index 0000000..e063caa
--- /dev/null
+++ b/doc/nbpublisher
@@ -0,0 +1 @@
+Subproject commit e063caa05b967dd0a516c26a2c279427767af8ac
From 968a8580b94995c14b4a20990bdd248c25b25bfe Mon Sep 17 00:00:00 2001
From: jlstevens
Date: Sun, 17 Apr 2016 11:58:29 +0100
Subject: [PATCH 05/15] Populated _static and _templates directories
---
doc/_static/rtd_bootstrap.css | 47 ++++++++++
doc/_templates/footer.html | 42 +++++++++
doc/_templates/layout.html | 162 ++++++++++++++++++++++++++++++++++
doc/_templates/page.html | 3 +
4 files changed, 254 insertions(+)
create mode 100644 doc/_static/rtd_bootstrap.css
create mode 100644 doc/_templates/footer.html
create mode 100644 doc/_templates/layout.html
create mode 100644 doc/_templates/page.html
diff --git a/doc/_static/rtd_bootstrap.css b/doc/_static/rtd_bootstrap.css
new file mode 100644
index 0000000..3afadb8
--- /dev/null
+++ b/doc/_static/rtd_bootstrap.css
@@ -0,0 +1,47 @@
+.wy-menu-vertical ul {
+ margin: 0 0 0 0 !important;
+}
+
+div.affix {
+ position: relative !important;
+}
+
+body {
+ font-family: "Lato","proxima-nova","Helvetica Neue",Arial,sans-serif !important;
+}
+
+.a:hover {
+ color: #b3b3b3 !important;
+}
+
+a.fa {
+ font-size: 200%;
+}
+
+.code :not(h1, h2, h3, h4, h5, h6) {
+ font-size: 80%;
+}
+
+div.wy-nav-content {
+ max-width: 90%;
+}
+
+input {
+ height: 30px !important;
+}
+
+code {
+ font-size: inherit !important;
+ color: #000 !important;
+}
+
+.rst-content dl:not(.docutils) dt {
+ margin: 0;
+ color: black;
+ background: none;
+ border-top: none;
+}
+
+.rst-content dd {
+ line-height: 2;
+}
diff --git a/doc/_templates/footer.html b/doc/_templates/footer.html
new file mode 100644
index 0000000..d81bd54
--- /dev/null
+++ b/doc/_templates/footer.html
@@ -0,0 +1,42 @@
+
diff --git a/doc/_templates/layout.html b/doc/_templates/layout.html
new file mode 100644
index 0000000..f19bc37
--- /dev/null
+++ b/doc/_templates/layout.html
@@ -0,0 +1,162 @@
+{# TEMPLATE VAR SETTINGS #}
+{%- set url_root = pathto('', 1) %}
+{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
+{%- if not embedded and docstitle %}
+ {%- set titlesuffix = " — "|safe + docstitle|e %}
+{%- else %}
+ {%- set titlesuffix = "" %}
+{%- endif %}
+
+
+
+
+
+
+
+
+
+ {% block htmltitle %}
+ {{ title|striptags|e }}{{ titlesuffix }}
+ {% endblock %}
+
+ {# FAVICON #}
+ {% if favicon %}
+
+ {% endif %}
+
+ {# CSS #}
+
+
+ {# OPENSEARCH #}
+ {% if not embedded %}
+ {% if use_opensearch %}
+
+ {% endif %}
+
+ {% endif %}
+
+ {# RTD hosts this file, so just load on non RTD builds #}
+ {% if not READTHEDOCS %}
+
+ {% endif %}
+
+ {% for cssfile in css_files %}
+
+ {% endfor %}
+
+ {%- block linktags %}
+ {%- if hasdoc('about') %}
+
+ {%- endif %}
+ {%- if hasdoc('genindex') %}
+
+ {%- endif %}
+ {%- if hasdoc('search') %}
+
+ {%- endif %}
+ {%- if hasdoc('copyright') %}
+
+ {%- endif %}
+
+ {%- if parents %}
+
+ {%- endif %}
+ {%- if next %}
+
+ {%- endif %}
+ {%- if prev %}
+
+ {%- endif %}
+ {%- endblock %}
+ {%- block extrahead %}
+ {%- for scriptfile in script_files %}
+
+ {%- endfor %}
+{% endblock %}
+
+
+ {# Keep modernizr in head - http://modernizr.com/docs/#installing #}
+
+
+
+
+
+
+
+
+ {# SIDE NAV, TOGGLES ON MOBILE #}
+
+
+
+
+ {# MOBILE NAV, TRIGGLES SIDE NAV ON TOGGLE #}
+
+
+
+ {# PAGE CONTENT #}
+
+
+
+ {% block body %}{% endblock %}
+
+ {% include "footer.html" %}
+
+
+
+
+
+
+ {% include "versions.html" %}
+
+ {% if not embedded %}
+
+
+ {% endif %}
+
+ {# STICKY NAVIGATION #}
+ {% if theme_sticky_navigation %}
+
+ {% endif %}
+
+ {%- block footer %} {% endblock %}
+
+
+
diff --git a/doc/_templates/page.html b/doc/_templates/page.html
new file mode 100644
index 0000000..9fd0405
--- /dev/null
+++ b/doc/_templates/page.html
@@ -0,0 +1,3 @@
+{% extends "!page.html" %}
+{# add our custom css and js #}
+{% set css_files = css_files + ["_static/bootstrap.css", "_static/codehilite.css", "_static/custom.css", "_static/rtd_bootstrap.css"] %}
From b19183acb5807be2faf3e7ebfe8080dda4af7a42 Mon Sep 17 00:00:00 2001
From: jlstevens
Date: Sun, 17 Apr 2016 11:59:31 +0100
Subject: [PATCH 06/15] Added initial content from ContinuumIO-sphinx-docs
branch
---
doc/Homepage.ipynb | 71 ++++++++++++++++++++++++++++++++++++++++++++
doc/index.rst | 46 +++++++++++++++++++---------
doc/latest_news.html | 5 ++++
3 files changed, 108 insertions(+), 14 deletions(-)
create mode 100644 doc/Homepage.ipynb
create mode 100644 doc/latest_news.html
diff --git a/doc/Homepage.ipynb b/doc/Homepage.ipynb
new file mode 100644
index 0000000..c538acd
--- /dev/null
+++ b/doc/Homepage.ipynb
@@ -0,0 +1,71 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "HoloCube is a [Python](http://python.org) library that makes it easy to explore and visualize geographical, meterological, oceanographic, and other multidimensional gridded datasets. HoloCube interfaces between the [HoloViews](http://holoviews.org) library for flexible visualizations of multidimensional data, the [Iris](http://scitools.org.uk/iris) library for storing and processing climate and weather data, and the [Cartopy](http://scitools.org.uk/cartopy) library for working with cartographic projections and visualizations in [Matplotlib](http://matplotlib.org/). Specifically, HoloCube:\n",
+ "\n",
+ "1. Extends HoloViews objects to allow them to use data stored in [Iris](http://scitools.org.uk/iris) [cubes](http://scitools.org.uk/iris/docs/latest/userguide/iris_cubes.html). After `import holocube`, data can be provided to any Holoviews `Element` directly as a cube, without needing to first convert into one of the other supported formats (NumPy arrays, Pandas data frames, etc.). This support is independent of the other support below -- data from Iris cubes can be used even in non-geographic `Element`s, and most geographic Elements can accept data in any format.\n",
+ "\n",
+ "2. Adds a set of new HoloViews `Element`s that have an associated geographic projection (`GeoElement`s), based on `cartopy.crs`. These currently include `GeoFeature`, `WMTS`, `GeoTiles`, `Points`, `Contours`, `Image`, and `Text` objects, each of which can easily be overlaid in the same plots. E.g. an object with temperature data can be overlaid with coastline data using an expression like ``Image(temp_cube)*hc.GeoFeature(cartopy.feature.COASTLINE)``. Each `GeoElement` can also be freely combined in layouts with any other HoloViews `Element`, making it simple to make even complex multi-figure layours.\n",
+ "\n",
+ "With HoloCube, you can now work easily and naturally with large, multidimensional datasets, instantly visualizing any subset or combination of them, while always being able to access the raw data underlying any plot. Here's a simple example:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "import holoviews as hv\n",
+ "import holocube as hc\n",
+ "from cartopy import crs\n",
+ "from cartopy import feature as cf\n",
+ "\n",
+ "hv.notebook_extension()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "%%opts GeoFeature [projection=crs.Geostationary()]\n",
+ "\n",
+ "coasts = hc.GeoFeature(cf.COASTLINE)\n",
+ "borders = hc.GeoFeature(cf.BORDERS)\n",
+ "ocean = hc.GeoFeature(cf.OCEAN)\n",
+ "\n",
+ "ocean + borders + (ocean*borders).relabel(\"Overlay\")"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/doc/index.rst b/doc/index.rst
index 6599c3a..49e2d8c 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -1,22 +1,40 @@
-.. CubeExplorer documentation master file, created by
- sphinx-quickstart on Tue Apr 12 14:07:39 2016.
- You can adapt this file completely to your liking, but it should at least
- contain the root `toctree` directive.
+.. HoloCube documentation master file
-Welcome to CubeExplorer's documentation!
-========================================
+.. raw:: html
+ :file: latest_news.html
-Contents:
+Introduction
+____________
-.. toctree::
- :maxdepth: 2
+.. notebook:: holocube Homepage.ipynb
+
+------------
+
+Installation
+____________
+See the `github repo `_
+for installation instructions and to get started with the examples.
+------------
-Indices and tables
-==================
+Support
+_______
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
+HoloCube was developed through a collaboration between
+`Continuum Analytics `_ and the `UK Metropolitan Office
+`_. HoloCube is completely `open source
+`_, available under a BSD license
+freely for both commercial and non-commercial use. Please file
+bug reports and feature requests on our
+`github site `_.
+
+.. toctree::
+ :titlesonly:
+ :hidden:
+ :maxdepth: 2
+ Home
+.. Tutorials
+.. Reference Manual
+ Github source
diff --git a/doc/latest_news.html b/doc/latest_news.html
new file mode 100644
index 0000000..c682125
--- /dev/null
+++ b/doc/latest_news.html
@@ -0,0 +1,5 @@
+
From 01b19ef7a53a2395a57fd773f2c8101e9d43a58b Mon Sep 17 00:00:00 2001
From: jlstevens
Date: Sun, 17 Apr 2016 12:00:37 +0100
Subject: [PATCH 07/15] Updated Makefile to make use of builder/Makefile
---
doc/Makefile | 217 ++-------------------------------------------------
1 file changed, 6 insertions(+), 211 deletions(-)
diff --git a/doc/Makefile b/doc/Makefile
index 4e0c1b0..1d0cc36 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -1,216 +1,11 @@
# Makefile for Sphinx documentation
#
-# You can set these variables from the command line.
-SPHINXOPTS =
-SPHINXBUILD = sphinx-build
-PAPER =
-BUILDDIR = _build
+PROJECT = 'holocube'
+MODULE = 'holocube'
-# User-friendly check for sphinx-build
-ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
-$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
-endif
+include ./builder/Makefile
+export
-# Internal variables.
-PAPEROPT_a4 = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-# the i18n builder cannot share the environment and doctrees with the others
-I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-
-.PHONY: help
-help:
- @echo "Please use \`make ' where is one of"
- @echo " html to make standalone HTML files"
- @echo " dirhtml to make HTML files named index.html in directories"
- @echo " singlehtml to make a single large HTML file"
- @echo " pickle to make pickle files"
- @echo " json to make JSON files"
- @echo " htmlhelp to make HTML files and a HTML help project"
- @echo " qthelp to make HTML files and a qthelp project"
- @echo " applehelp to make an Apple Help Book"
- @echo " devhelp to make HTML files and a Devhelp project"
- @echo " epub to make an epub"
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
- @echo " latexpdf to make LaTeX files and run them through pdflatex"
- @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
- @echo " text to make text files"
- @echo " man to make manual pages"
- @echo " texinfo to make Texinfo files"
- @echo " info to make Texinfo files and run them through makeinfo"
- @echo " gettext to make PO message catalogs"
- @echo " changes to make an overview of all changed/added/deprecated items"
- @echo " xml to make Docutils-native XML files"
- @echo " pseudoxml to make pseudoxml-XML files for display purposes"
- @echo " linkcheck to check all external links for integrity"
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
- @echo " coverage to run coverage check of the documentation (if enabled)"
-
-.PHONY: clean
-clean:
- rm -rf $(BUILDDIR)/*
-
-.PHONY: html
-html:
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
-
-.PHONY: dirhtml
-dirhtml:
- $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
- @echo
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
-
-.PHONY: singlehtml
-singlehtml:
- $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
- @echo
- @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
-
-.PHONY: pickle
-pickle:
- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
- @echo
- @echo "Build finished; now you can process the pickle files."
-
-.PHONY: json
-json:
- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
- @echo
- @echo "Build finished; now you can process the JSON files."
-
-.PHONY: htmlhelp
-htmlhelp:
- $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
- @echo
- @echo "Build finished; now you can run HTML Help Workshop with the" \
- ".hhp project file in $(BUILDDIR)/htmlhelp."
-
-.PHONY: qthelp
-qthelp:
- $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
- @echo
- @echo "Build finished; now you can run "qcollectiongenerator" with the" \
- ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/CubeExplorer.qhcp"
- @echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/CubeExplorer.qhc"
-
-.PHONY: applehelp
-applehelp:
- $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
- @echo
- @echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
- @echo "N.B. You won't be able to view it unless you put it in" \
- "~/Library/Documentation/Help or install it in your application" \
- "bundle."
-
-.PHONY: devhelp
-devhelp:
- $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
- @echo
- @echo "Build finished."
- @echo "To view the help file:"
- @echo "# mkdir -p $$HOME/.local/share/devhelp/CubeExplorer"
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/CubeExplorer"
- @echo "# devhelp"
-
-.PHONY: epub
-epub:
- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
- @echo
- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
-
-.PHONY: latex
-latex:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo
- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
- @echo "Run \`make' in that directory to run these through (pdf)latex" \
- "(use \`make latexpdf' here to do that automatically)."
-
-.PHONY: latexpdf
-latexpdf:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo "Running LaTeX files through pdflatex..."
- $(MAKE) -C $(BUILDDIR)/latex all-pdf
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-.PHONY: latexpdfja
-latexpdfja:
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
- @echo "Running LaTeX files through platex and dvipdfmx..."
- $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
-
-.PHONY: text
-text:
- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
- @echo
- @echo "Build finished. The text files are in $(BUILDDIR)/text."
-
-.PHONY: man
-man:
- $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
- @echo
- @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
-
-.PHONY: texinfo
-texinfo:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo
- @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
- @echo "Run \`make' in that directory to run these through makeinfo" \
- "(use \`make info' here to do that automatically)."
-
-.PHONY: info
-info:
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
- @echo "Running Texinfo files through makeinfo..."
- make -C $(BUILDDIR)/texinfo info
- @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
-
-.PHONY: gettext
-gettext:
- $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
- @echo
- @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
-
-.PHONY: changes
-changes:
- $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
- @echo
- @echo "The overview file is in $(BUILDDIR)/changes."
-
-.PHONY: linkcheck
-linkcheck:
- $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
- @echo
- @echo "Link check complete; look for any errors in the above output " \
- "or in $(BUILDDIR)/linkcheck/output.txt."
-
-.PHONY: doctest
-doctest:
- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
- @echo "Testing of doctests in the sources finished, look at the " \
- "results in $(BUILDDIR)/doctest/output.txt."
-
-.PHONY: coverage
-coverage:
- $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
- @echo "Testing of coverage in the sources finished, look at the " \
- "results in $(BUILDDIR)/coverage/python.txt."
-
-.PHONY: xml
-xml:
- $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
- @echo
- @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
-
-.PHONY: pseudoxml
-pseudoxml:
- $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
- @echo
- @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
+%:
+ $(MAKE) -f ./builder/Makefile $(CFLAGS)
From 584bafba52fe4d16921d70441020b2f5c4d07db0 Mon Sep 17 00:00:00 2001
From: jlstevens
Date: Sun, 17 Apr 2016 12:04:30 +0100
Subject: [PATCH 08/15] Updated conf.py to use builder.shared_conf and nbbuild
---
doc/conf.py | 358 +++++++---------------------------------------------
1 file changed, 45 insertions(+), 313 deletions(-)
diff --git a/doc/conf.py b/doc/conf.py
index 5b6e832..66db724 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -1,366 +1,98 @@
# -*- coding: utf-8 -*-
-#
-# CubeExplorer documentation build configuration file, created by
-# sphinx-quickstart on Tue Apr 12 14:07:39 2016.
-#
-# This file is execfile()d with the current directory set to its
-# containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-import sys
-import os
+import sys, os
+sys.path.insert(0, os.getcwd())
-# 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.
-#sys.path.insert(0, os.path.abspath('.'))
+from builder.shared_conf import * # noqa (API import)
-# -- General configuration ------------------------------------------------
+paths = ['../param/', '.', '..']
+add_paths(paths)
-# 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.doctest',
- 'sphinx.ext.intersphinx',
- 'sphinx.ext.todo',
- 'sphinx.ext.coverage',
- 'sphinx.ext.mathjax',
- 'sphinx.ext.ifconfig',
- 'sphinx.ext.viewcode',
-]
-
-# 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 encoding of source files.
-#source_encoding = 'utf-8-sig'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General information about the project.
+# # General information about the project.
project = u'CubeExplorer'
copyright = u'2016, CubeExplorer developers'
-author = u'CubeExplorer developers'
+authors = u'CubeExplorer developers'
+module = 'holocube'
+description = 'Browser based exploration of Iris cubes'
+
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
+# # The short X.Y version.
version = u'v0.1'
# The full version, including alpha/beta/rc tags.
release = u'v0.1'
-# 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
+# Override default theme
+import sphinx_rtd_theme
+html_theme = "sphinx_rtd_theme"
+html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
+html_logo = ''
+html_favicon = ''
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
+# -------------------------------------------------------------------------
+# -- The remaining items are less likely to need changing for a new project
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
-exclude_patterns = ['_build']
-
-# The reST default role (used for this markup: `text`) to use for all
-# documents.
-#default_role = None
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-# If true, keep warnings as "system message" paragraphs in the built documents.
-#keep_warnings = False
-
-# If true, `todo` and `todoList` produce output, else they produce nothing.
-todo_include_todos = True
-
-
-# -- 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 = 'alabaster'
-
-# 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 themes here, relative to this directory.
-#html_theme_path = []
+exclude_patterns = ['_build', 'test_data', 'reference_data', 'nbpublisher',
+ 'builder']
# The name for this set of Sphinx documents. If None, it defaults to
# " v documentation".
-#html_title = None
-
-# A shorter title for the navigation bar. Default is the same as html_title.
-#html_short_title = None
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-#html_logo = None
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-#html_favicon = None
+html_title = project
# 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']
-
-# Add any extra paths that contain custom files (such as robots.txt or
-# .htaccess) here, relative to this directory. These files are copied
-# directly to the root of the documentation.
-#html_extra_path = []
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_domain_indices = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a tag referring to it. The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# This is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = None
-
-# Language to be used for generating the HTML full-text search index.
-# Sphinx supports the following languages:
-# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
-# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
-#html_search_language = 'en'
-
-# A dictionary with options for the search language support, empty by default.
-# Now only 'ja' uses this config value
-#html_search_options = {'type': 'default'}
-
-# The name of a javascript file (relative to the configuration directory) that
-# implements a search results scorer. If empty, the default will be used.
-#html_search_scorer = 'scorer.js'
+html_static_path = ['_static', 'builder/_shared_static']
# Output file base name for HTML help builder.
-htmlhelp_basename = 'CubeExplorerdoc'
-
-# -- 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': '',
+htmlhelp_basename = module+'doc'
-# 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, 'CubeExplorer.tex', u'CubeExplorer Documentation',
- u'CubeExplorer developers', 'manual'),
+ ('index', module+'.tex', project+u' Documentation', authors, 'manual'),
]
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
-
-# -- 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, 'cubeexplorer', u'CubeExplorer Documentation',
- [author], 1)
+ ('index', module, project+u' Documentation', [authors], 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, 'CubeExplorer', u'CubeExplorer Documentation',
- author, 'CubeExplorer', 'One line description of project.',
- 'Miscellaneous'),
+ ('index', project, project+u' Documentation', authors, project, description,
+ '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
+# Example configuration for intersphinx: refer to the Python standard library.
+intersphinx_mapping = {'http://docs.python.org/': None,
+ 'http://ipython.org/ipython-doc/2/': None,
+ 'http://ioam.github.io/param/': None}
-# -- Options for Epub output ----------------------------------------------
-
-# Bibliographic Dublin Core info.
-epub_title = project
-epub_author = author
-epub_publisher = author
-epub_copyright = copyright
-
-# The basename for the epub file. It defaults to the project name.
-#epub_basename = project
-
-# The HTML theme for the epub output. Since the default themes are not
-# optimized for small screen space, using the same theme for HTML and epub
-# output is usually not wise. This defaults to 'epub', a theme designed to save
-# visual space.
-#epub_theme = 'epub'
-
-# The language of the text. It defaults to the language option
-# or 'en' if the language is not set.
-#epub_language = ''
-
-# The scheme of the identifier. Typical schemes are ISBN or URL.
-#epub_scheme = ''
-
-# The unique identifier of the text. This can be a ISBN number
-# or the project homepage.
-#epub_identifier = ''
-
-# A unique identification for the text.
-#epub_uid = ''
-
-# A tuple containing the cover image and cover page html template filenames.
-#epub_cover = ()
-
-# A sequence of (type, uri, title) tuples for the guide element of content.opf.
-#epub_guide = ()
-
-# HTML files that should be inserted before the pages created by sphinx.
-# The format is a list of tuples containing the path and title.
-#epub_pre_files = []
-
-# HTML files that should be inserted after the pages created by sphinx.
-# The format is a list of tuples containing the path and title.
-#epub_post_files = []
-
-# A list of files that should not be packed into the epub file.
-epub_exclude_files = ['search.html']
-
-# The depth of the table of contents in toc.ncx.
-#epub_tocdepth = 3
-
-# Allow duplicate toc entries.
-#epub_tocdup = True
-
-# Choose between 'default' and 'includehidden'.
-#epub_tocscope = 'default'
-
-# Fix unsupported image types using the Pillow.
-#epub_fix_images = False
-
-# Scale large images.
-#epub_max_image_width = 0
+js_includes = ['require.js', 'bootstrap.js', 'custom.js', 'js/theme.js']
-# How to display URL addresses: 'footnote', 'no', or 'inline'.
-#epub_show_urls = 'inline'
+from builder.paramdoc import param_formatter
+from nbpublisher import nbbuild
-# If false, no index is generated.
-#epub_use_index = True
+def setup(app):
+ app.connect('autodoc-process-docstring', param_formatter)
+ for js in js_includes:
+ app.add_javascript(js)
-# Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {'https://docs.python.org/': None}
+ try:
+ import runipy # noqa (Warning import)
+ nbbuild.setup(app)
+ except:
+ print('RunIPy could not be imported; pages including the '
+ 'Notebook directive will not build correctly')
From 0a5211555a1823fd1360d3135833d972367049ae Mon Sep 17 00:00:00 2001
From: jlstevens
Date: Sun, 17 Apr 2016 14:56:05 +0100
Subject: [PATCH 09/15] Extended homepage notebook example
---
doc/Homepage.ipynb | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/doc/Homepage.ipynb b/doc/Homepage.ipynb
index c538acd..21a5261 100644
--- a/doc/Homepage.ipynb
+++ b/doc/Homepage.ipynb
@@ -45,6 +45,45 @@
"\n",
"ocean + borders + (ocean*borders).relabel(\"Overlay\")"
]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "The following example loads a cube from [iris-sample-data](https://github.com/SciTools/iris-sample-data) and displays it as follows:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "import iris\n",
+ "surface_temp = iris.load_cube(iris.sample_data_path('GloSea4', 'ensemble_001.pp'))\n",
+ "print surface_temp.summary()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "With HoloViews, you can quickly view the data in the cube interactively:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "%%opts GeoImage [colorbar=True] (cmap='viridis')\n",
+ "(hc.HoloCube(surface_temp).groupby(['time'], group_type=hc.Image) * hc.GeoFeature(cf.COASTLINE))"
+ ]
}
],
"metadata": {
From fd057dd9c5a39c1a51818cd8698a5f836f989333 Mon Sep 17 00:00:00 2001
From: jlstevens
Date: Sun, 17 Apr 2016 20:14:19 +0100
Subject: [PATCH 10/15] Updated conf.py to refer to HoloCube instead of
CubeExplorer
---
doc/conf.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/conf.py b/doc/conf.py
index 66db724..6ca2b2c 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -9,9 +9,9 @@
add_paths(paths)
# # General information about the project.
-project = u'CubeExplorer'
-copyright = u'2016, CubeExplorer developers'
-authors = u'CubeExplorer developers'
+project = u'HoloCube'
+copyright = u'2016, HoloCube developers'
+authors = u'HoloCube developers'
module = 'holocube'
description = 'Browser based exploration of Iris cubes'
From 8c42c796f681b212654b382b6864c9dfbe89cfdc Mon Sep 17 00:00:00 2001
From: Philipp Rudiger
Date: Sun, 17 Apr 2016 23:53:59 +0100
Subject: [PATCH 11/15] Removed holoviews Google Analytics tracker
---
doc/_templates/footer.html | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/doc/_templates/footer.html b/doc/_templates/footer.html
index d81bd54..0443595 100644
--- a/doc/_templates/footer.html
+++ b/doc/_templates/footer.html
@@ -28,15 +28,4 @@
-
From 37a5c534a5108726b8ae686dcc16244c07e4ea7b Mon Sep 17 00:00:00 2001
From: Philipp Rudiger
Date: Sun, 17 Apr 2016 23:54:20 +0100
Subject: [PATCH 12/15] Reordered JS imports
---
doc/conf.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/conf.py b/doc/conf.py
index 6ca2b2c..8d18562 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -79,7 +79,7 @@
'http://ipython.org/ipython-doc/2/': None,
'http://ioam.github.io/param/': None}
-js_includes = ['require.js', 'bootstrap.js', 'custom.js', 'js/theme.js']
+js_includes = ['js/theme.js', 'bootstrap.js', 'custom.js', 'require.js']
from builder.paramdoc import param_formatter
from nbpublisher import nbbuild
From 2ae09d9402837ce0000f33766307162097444b98 Mon Sep 17 00:00:00 2001
From: Philipp Rudiger
Date: Mon, 18 Apr 2016 00:00:14 +0100
Subject: [PATCH 13/15] Updated builder submodule reference
---
doc/builder | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/builder b/doc/builder
index fe584ca..6981060 160000
--- a/doc/builder
+++ b/doc/builder
@@ -1 +1 @@
-Subproject commit fe584ca37d850315c21fa9e7602f56213c7a48ca
+Subproject commit 6981060600659149cbb894640b0451ea658024b5
From 6cdaf48defadb199fddfe58d3fbf1e6c75e43b15 Mon Sep 17 00:00:00 2001
From: jlstevens
Date: Mon, 18 Apr 2016 01:08:41 +0100
Subject: [PATCH 14/15] Added doc/Introductory_Tutorial.ipynb notebook
---
doc/Introductory_Tutorial.ipynb | 386 ++++++++++++++++++++++++++++++++
1 file changed, 386 insertions(+)
create mode 100644 doc/Introductory_Tutorial.ipynb
diff --git a/doc/Introductory_Tutorial.ipynb b/doc/Introductory_Tutorial.ipynb
new file mode 100644
index 0000000..24ce597
--- /dev/null
+++ b/doc/Introductory_Tutorial.ipynb
@@ -0,0 +1,386 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "The Iris cubes used in this notebook are publicly available in the [``SciTools/iris-sample-data``](https://github.com/SciTools/iris-sample-data) repository. This notebook is based on the user story described in [Issue #7](https://github.com/CubeBrowser/cube-explorer/issues/7) with the following [image](http://www.wetterzentrale.de/wz/pics/Recm1201.gif) suggested for inspiration."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "import datetime\n",
+ "import iris\n",
+ "import numpy as np\n",
+ "import holoviews as hv\n",
+ "import holocube as hc\n",
+ "from cartopy import crs\n",
+ "from cartopy import feature as cf\n",
+ "hv.notebook_extension()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Setting some notebook-wide options"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Let's start by setting some normalization options (discussed below) and always enable colorbars for the elements we will be displaying:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "iris.FUTURE.strict_grib_load = True\n",
+ "%opts Image {+framewise} [colorbar=True] Contours [colorbar=True] {+framewise} Curve [xrotation=60]"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Note that it is easy to set global defaults for a project allowing any suitable settings can be made into a default on a per-element basis. Now lets specify the maximum number of frames we will be displaying:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "%output max_frames=1000 "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "\n",
+ "
When working on a live server append ``widgets='live'`` to the line above for greatly improved performance and memory usage
\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Loading our first cube"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Here is the summary of the first cube containing some surface temperature data:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "iris_cube = iris.load_cube(iris.sample_data_path('GloSea4', 'ensemble_001.pp'))\n",
+ "iris_cube.coord('latitude').guess_bounds()\n",
+ "iris_cube.coord('longitude').guess_bounds()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "print iris_cube.summary()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Now we can wrap this Iris cube in a ``HoloCube``:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "surface_temperature = hc.HoloCube(iris_cube)\n",
+ "surface_temperature"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# A Simple example"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Here is a simple example of viewing the ``surface_temperature`` cube over time with a single line of code. In HoloViews, this datastructure is a ``HoloMap`` of ``Image`` elements:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "surface_temperature.to.image(['longitude', 'latitude'])"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "You can drag the slider to view the surface temperature at different times. Here is how you can view the values of time in the cube via the HoloViews API:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "surface_temperature.dimension_values('time')"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "The times shown in the slider are long making the text rather small. We can use the fact that all times are recorded in the year 2011 on the 16th of each month to shorten these dates. Defining how all dates should be formatted as follows will help with readability:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "hv.Dimension.type_formatters[datetime.datetime] = \"%m/%y %Hh\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Now let us load a cube showing the pre-industrial air temperature:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "air_temperature = hc.HoloCube(iris.load_cube(iris.sample_data_path('pre-industrial.pp')),\n",
+ " group='Pre-industrial air temperature')\n",
+ "air_temperature.data.coord('longitude').guess_bounds()\n",
+ "air_temperature.data.coord('latitude').guess_bounds()\n",
+ "air_temperature # Use air_temperature.data.summary() to see the Iris summary (.data is the Iris cube)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Note that we have the ``air_temperature`` available over ``longitude`` and ``latitude`` but *not* the ``time`` dimensions. As a result, this cube is a single frame when visualized as a temperature map."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "(surface_temperature.to.image(['longitude', 'latitude']) + air_temperature.to.image(['longitude', 'latitude']))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Next is a fairly involved example that plots data side-by-side in a ``Layout`` without using the ``+`` operator. \n",
+ "\n",
+ "This shows how complex plots can be generated with little code and also demonstrates how different HoloViews elements can be combined together. In the following visualization, the curve is a sample of the ``surface_temperature`` at longitude and latitude *(0,10)*:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "%%opts Layout [fig_inches=(12,7)] Curve [aspect=2 xticks=4 xrotation=20] Points (color=2)\n",
+ "# Sample the surface_temperature at (0,10)\n",
+ "temp_curve = surface_temperature.to.curve('time', dynamic=True)[0, 10]\n",
+ "# Show surface_temperature and air_temperature with Point (0,10) marked\n",
+ "temp_maps = [cb.to.image(['longitude', 'latitude']) * hc.Points([(0,10)]) \n",
+ " for cb in [surface_temperature, air_temperature]]\n",
+ "# Show everything in a two column layout\n",
+ "hv.Layout(temp_maps + [temp_curve]).cols(2).display('all')"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Overlaying data and normalization"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Lets view the surface temperatures together with the global coastline:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "cf.COASTLINE.scale='1000m'"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "%%opts Image [projection=crs.Geostationary()] (cmap='Greens')\n",
+ "surface_temperature.to.image(['longitude', 'latitude']) * hc.GeoFeature(cf.COASTLINE)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Notice that every frame uses the full dynamic range of the Greens color map. This is because normalization is set to ``+framewise`` at the top of the notebook which means every frame is normalized independently. \n",
+ "\n",
+ "To control normalization, we need to decide on the normalization limits. Let's see the maximum temperature in the cube:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "max_surface_temp = surface_temperature.data.data.max()\n",
+ "max_surface_temp"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "%%opts Image [projection=crs.Geostationary()] (cmap='Greens')\n",
+ "# Declare a humidity dimension with a range from 0 to 0.01\n",
+ "surface_temp_dim = hv.Dimension('surface_temperature', range=(300, max_surface_temp))\n",
+ "# Use it to declare the value dimension of a HoloCube\n",
+ "(hc.HoloCube(surface_temperature, vdims=[surface_temp_dim]).to.image(['longitude', 'latitude']) * hc.GeoFeature(cf.COASTLINE))"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "By specifying the normalization range we can reveal different aspects of the data. In the example above we can see a warming effect over time as the dark green areas close to the bottom of the normalization range (200K) vanish. Values outside this range are clipped to the ends of the color map."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Lastly, here is a demo of a conversion from ``surface_temperature`` to ``Contours``:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "%%opts Contours [levels=10]\n",
+ "(surface_temperature.to.contours(['longitude', 'latitude']) * hc.GeoFeature(cf.COASTLINE))"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.11"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
From 3245f8b530e5cf912a2e4c8e2c257353a29d2135 Mon Sep 17 00:00:00 2001
From: jlstevens
Date: Mon, 18 Apr 2016 01:45:52 +0100
Subject: [PATCH 15/15] Added Introductory_Tutorial.rst and updated toc
---
doc/Introductory_Tutorial.rst | 5 +++++
doc/index.rst | 6 ++++--
2 files changed, 9 insertions(+), 2 deletions(-)
create mode 100644 doc/Introductory_Tutorial.rst
diff --git a/doc/Introductory_Tutorial.rst b/doc/Introductory_Tutorial.rst
new file mode 100644
index 0000000..b5478c0
--- /dev/null
+++ b/doc/Introductory_Tutorial.rst
@@ -0,0 +1,5 @@
+Introductory Tutorial
+=====================
+
+.. notebook:: holocube Introductory_Tutorial.ipynb
+
diff --git a/doc/index.rst b/doc/index.rst
index 49e2d8c..21832cf 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -10,6 +10,9 @@ ____________
------------
+This website is still under construction but you can get a taste of what
+is to come in our `first tutorial `_.
+
Installation
____________
@@ -35,6 +38,5 @@ bug reports and feature requests on our
:maxdepth: 2
Home
-.. Tutorials
-.. Reference Manual
+ Introductory Tutorial
Github source