diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..cb6f40a684fe75a70351c3847c2c794b1cdee6b3 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = python -msphinx +SPHINXPROJ = TOPFARM +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) \ No newline at end of file diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000000000000000000000000000000000000..b24108efb6ac5838be8c8a5236023721a20a7cb8 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,36 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=python -msphinx +) +set SOURCEDIR=source +set BUILDDIR=build +set SPHINXPROJ=TOPFARM + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The Sphinx module was not found. Make sure you have Sphinx installed, + echo.then set the SPHINXBUILD environment variable to point to the full + echo.path of the 'sphinx-build' executable. Alternatively you may add the + echo.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 diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000000000000000000000000000000000000..7399b447073caf7c9546ac16b03e710b87d19f98 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,182 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# TOPFARM documentation build configuration file, created by +# sphinx-quickstart on Tue May 1 18:31:31 2018. +# +# 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. + +# 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('.')) + + +# -- 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.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 master toctree document. +master_doc = 'index' + +# General information about the project. +project = 'TOPFARM' +copyright = '2018, DTU Wind Energy' +author = 'DTU Wind Energy' + +# 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 = '2.0' +# The full version, including alpha/beta/rc tags. +release = '2.0a' + +# 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 patterns also effect to html_static_path and html_extra_path +exclude_patterns = [] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# 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 = '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 = { + # TOC options + 'navigation_depth': 2, # only show 2 levels on left sidebar + 'collapse_navigation': False, # don't allow sidebar to collapse + } + + + + +# 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. (required for alabaster theme) +# +# html_sidebars = {} + + +# -- Options for HTMLHelp output ------------------------------------------ + +# Output file base name for HTML help builder. +htmlhelp_basename = 'TOPFARMdoc' + + +# -- 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, 'TOPFARM.tex', 'TOPFARM Documentation', + 'DTU Wind Energy', '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, 'topfarm', 'TOPFARM 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, 'TOPFARM', 'TOPFARM Documentation', + author, 'TOPFARM', 'One line description of project.', + 'Miscellaneous'), +] + + + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { +'python': ('https://docs.python.org/3.4', None), +'pandas': ('http://pandas-docs.github.io/pandas-docs-travis', None), +'numpy': ('http://docs.scipy.org/doc/numpy-1.13.0', None) +} diff --git a/docs/source/dev_guide/bookkeeping.rst b/docs/source/dev_guide/bookkeeping.rst new file mode 100644 index 0000000000000000000000000000000000000000..e416ec6d92d55ebf2fb32c1eebbd9bb3929d82a0 --- /dev/null +++ b/docs/source/dev_guide/bookkeeping.rst @@ -0,0 +1,66 @@ +.. _bookkeeping: + + +======================= +Bookkeeping +======================= + + +GitLab project settings +----------------------- + + +I think there's an artist hidden in the bottom of every single one of us. +This is the fun part. +This is your world. +Little trees and bushes grow however makes them happy. +Trees cover up a multitude of sins. +We'll paint one happy little tree right here. + +Runners +------- + +Isn't that fantastic that you can create an almighty tree that fast? +We might as well make some Almighty mountains today as well, what the heck. +Fluff it up a little and hypnotize it. +We're not trying to teach you a thing to copy. +We're just here to teach you a technique, then let you loose into the world. + +Documentation generation +------------------------ + +1. Run ``sphinx-quickstart`` with the following options: + + * root path: docs + * separate source and build: y + * Name prefix: '_' + * (Project name, Author, version, etc. particular to TOPFARM) + * Project language: en + * Source file suffix: .rst + * Name of master document: index + * Use the epub builder: n + * autodoc: y + * doctest: y + * intersphinx: y + * todo: y + * coverage: y + * imgmath: n + * mathjax: n + * ifconfig: n + * viewcode: y + * githubpages: n + * Makefile: y + * Windows command file: y + +2. Make a few changes to the generated ``conf.py``: + + * Change ``html_theme`` to ``sphinx_rtd_theme`` + * ``html_theme_options = { + # Toc options + 'navigation_depth': 2, + 'collapse_navigation': False}`` + * Remove ``html_sidebars`` + * Add elements for intersphinx mapping (see ``conf.py``) + +3. Manually change ``index.rst`` for content that is not generated + automatically. diff --git a/docs/source/dev_guide/dev_workflow.rst b/docs/source/dev_guide/dev_workflow.rst new file mode 100644 index 0000000000000000000000000000000000000000..09520346c13e5386cf1c7117761606f653b4e734 --- /dev/null +++ b/docs/source/dev_guide/dev_workflow.rst @@ -0,0 +1,55 @@ +.. _dev_workflow: + +======================= +Development Workflow +======================= + +A fan brush is a fantastic piece of equipment. +Use it. +Make friends with it. +Go out on a limb - that's where the fruit is. + + + +Branching vs. forking +--------------------- + + +I think there's an artist hidden in the bottom of every single one of us. +This is the fun part. +This is your world. +Little trees and bushes grow however makes them happy. +Trees cover up a multitude of sins. +We'll paint one happy little tree right here. + + +Merging to master +----------------- + +Isn't that fantastic that you can create an almighty tree that fast? +We might as well make some Almighty mountains today as well, what the heck. +Fluff it up a little and hypnotize it. +We're not trying to teach you a thing to copy. +We're just here to teach you a technique, then let you loose into the world. + + +GitLab and GitHub +----------------- + +Decide where your cloud lives. Maybe he lives right in here. +The little tiny Tim easels will let you down. +Here's something that's fun. If you do too much it's going to lose its effectiveness. + + +Issue tracking +-------------- + +But they're very easily killed. +Clouds are delicate. +Go out on a limb - that's where the fruit is. +Now it's beginning to make a little sense. +You have to make these big decisions. +In painting, you have unlimited power. +You have the ability to move mountains. You can bend rivers. +But when I get home, the only thing I have power over is the garbage. +That's a crooked tree. We'll send him to Washington. diff --git a/docs/source/dev_guide/docker_settings.rst b/docs/source/dev_guide/docker_settings.rst new file mode 100644 index 0000000000000000000000000000000000000000..68a40a643c42e1920970aa04edeb5cd324dc337c --- /dev/null +++ b/docs/source/dev_guide/docker_settings.rst @@ -0,0 +1,27 @@ +.. _docker_settings: + +======================= +Docker Settings +======================= + + +Background +---------- + +A fan brush is a fantastic piece of equipment. +Use it. +Make friends with it. +Go out on a limb - that's where the fruit is. + + +Image configuration +------------------- + + +I think there's an artist hidden in the bottom of every single one of us. +This is the fun part. +This is your world. +Little trees and bushes grow however makes them happy. +Trees cover up a multitude of sins. +We'll paint one happy little tree right here. + diff --git a/docs/source/dev_guide/quick_guide.rst b/docs/source/dev_guide/quick_guide.rst new file mode 100644 index 0000000000000000000000000000000000000000..09203e2a8a7f38fe177a7f752514f259c8fa5e57 --- /dev/null +++ b/docs/source/dev_guide/quick_guide.rst @@ -0,0 +1,9 @@ +.. _quick_guide: + +======================= +Quick Reference +======================= + +1. Do this first. +2. Then do this. +3. Lastly, this. diff --git a/docs/source/dev_guide/test_docs.rst b/docs/source/dev_guide/test_docs.rst new file mode 100644 index 0000000000000000000000000000000000000000..df59658035751edda904960df315cf0d2c485371 --- /dev/null +++ b/docs/source/dev_guide/test_docs.rst @@ -0,0 +1,59 @@ +.. _test_docs: + +=========================== +Testing and Documentation +=========================== + +A fan brush is a fantastic piece of equipment. +Use it. +Make friends with it. +Go out on a limb - that's where the fruit is. + + + +Coverage requirements +--------------------- + + +I think there's an artist hidden in the bottom of every single one of us. +This is the fun part. +This is your world. +Little trees and bushes grow however makes them happy. +Trees cover up a multitude of sins. +We'll paint one happy little tree right here. + + +Docstring formatting +-------------------- + +Isn't that fantastic that you can create an almighty tree that fast? +We might as well make some Almighty mountains today as well, what the heck. +Fluff it up a little and hypnotize it. +We're not trying to teach you a thing to copy. +We're just here to teach you a technique, then let you loose into the world. + +Updating the documentation +-------------------------- + +The workflow for updating the documentation is slightly different +than updating code. Namely, you must build the docs locally using +sphinx to make sure everything looks okay before you push. Here is +the workflow for updating documentation: + +1. Create a branch ``docs`` from branch ``master``. If it already + exists, contact whoever pushed last to make sure their changes + were merged into ``master`` and have them delete the branch. +2. Make your change to the documentation. +3. Locally build the documentation using whatever terminal prompt you + like (e.g., Anaconda Prompt, etc) by executing this command from + the ``docs`` folder on your computer: + ``make html`` +4. In the created ``build/html`` folder, double-click ``index.html`` + and navigate around the resulting docs to make sure your changes + are good. +5. Push your local ``docs`` branch to GitLab, create a merge request, + and assign someone else to review it. +6. If you're the reviewer, check the changes but also build the docs + locally to see how they look. +7. Once the merge request is accepted, delete the ``docs`` branch + both on GitLab and locally. diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..1219b41539f662f4ad56230c320b8375f471c4e8 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,33 @@ +.. TOPFARM documentation master file, created by + sphinx-quickstart on Tue May 1 18:31:31 2018. + Modified manually for non-auto-gen content. + +Welcome to TOPFARM, the wind-farm optimizer +=========================================== + +.. toctree:: + :caption: User Guide + :maxdepth: 2 + + user_guide/overview + user_guide/installation + user_guide/faqs + +.. toctree:: + :caption: Developer Guide + :maxdepth: 2 + + dev_guide/quick_guide + dev_guide/dev_workflow + dev_guide/test_docs + dev_guide/docker_settings + dev_guide/bookkeeping + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/docs/source/user_guide/faqs.rst b/docs/source/user_guide/faqs.rst new file mode 100644 index 0000000000000000000000000000000000000000..6b8c63a235a47bf278ae1f6f90216045bbc4453c --- /dev/null +++ b/docs/source/user_guide/faqs.rst @@ -0,0 +1,11 @@ +.. _faqs: + +=========================== +Frequently Asked Questions +=========================== + +1. How do I install TOPFARM? +2. Something is not working in TOPFARM. + What do I do? +3. How do I contact the developers? +4. How can I add my own models to TOPFARM? diff --git a/docs/source/user_guide/installation.rst b/docs/source/user_guide/installation.rst new file mode 100644 index 0000000000000000000000000000000000000000..81e38420f047df5b126080fb4e083d7749f770b1 --- /dev/null +++ b/docs/source/user_guide/installation.rst @@ -0,0 +1,28 @@ +.. _installation: + +=========================== +Installation +=========================== + +How you install TOPFARM on your system. + + +Windows +------- + +Isn't that fantastic that you can create an almighty tree that fast? +We might as well make some Almighty mountains today as well, what the heck. +Fluff it up a little and hypnotize it. +We're not trying to teach you a thing to copy. +We're just here to teach you a technique, then let you loose into the world. + + +Mac/Linux +--------- + +I think there's an artist hidden in the bottom of every single one of us. +This is the fun part. +This is your world. +Little trees and bushes grow however makes them happy. +Trees cover up a multitude of sins. +We'll paint one happy little tree right here. diff --git a/docs/source/user_guide/overview.rst b/docs/source/user_guide/overview.rst new file mode 100644 index 0000000000000000000000000000000000000000..e18c922dfe721e1a936641de37dc6212b33c2b19 --- /dev/null +++ b/docs/source/user_guide/overview.rst @@ -0,0 +1,33 @@ +.. _overview: + +=========================== +Overview +=========================== + +What is TOPFARM? +Why should you use it? + + +How to use the docs +------------------- + +User guide, developer guide, installation, FAQs. + +Isn't that fantastic that you can create an almighty tree that fast? +We might as well make some Almighty mountains today as well, what the heck. +Fluff it up a little and hypnotize it. +We're not trying to teach you a thing to copy. +We're just here to teach you a technique, then let you loose into the world. + + +Code structure +-------------- + +TOPFARM versus FUSED-Wake et al. + +I think there's an artist hidden in the bottom of every single one of us. +This is the fun part. +This is your world. +Little trees and bushes grow however makes them happy. +Trees cover up a multitude of sins. +We'll paint one happy little tree right here.