Skip to content

Commit

Permalink
Documentation Update
Browse files Browse the repository at this point in the history
Added API documentation and updated the tutorial links.
  • Loading branch information
lowcloudnine committed Jun 3, 2016
1 parent 24c2437 commit 1a86a20
Show file tree
Hide file tree
Showing 21 changed files with 90 additions and 30 deletions.
5 changes: 1 addition & 4 deletions docs/adv_tutorial.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@

Introduction to Mesa
====================

Advanced Tutorial
-----------------
=================

Adding visualization
~~~~~~~~~~~~~~~~~~~~
Expand Down
5 changes: 5 additions & 0 deletions docs/batchrunner.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Batchrunner
-----------

.. automodule:: batchrunner
:members:
25 changes: 13 additions & 12 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,23 @@


# Adding mock imports to see if this builds
from unittest.mock import MagicMock

class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return Mock()

MOCK_MODULES = ['numpy', 'pandas']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
# from unittest.mock import MagicMock
#
# class Mock(MagicMock):
# @classmethod
# def __getattr__(cls, name):
# return Mock()
#
# MOCK_MODULES = ['numpy', 'pandas']
# sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

# End of mock

# 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('.'))
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, "../mesa")

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

Expand Down Expand Up @@ -141,12 +142,12 @@ def __getattr__(cls, name):

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
html_logo = "images/mesa_logo.png"

# 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_favicon = "images/mesa_logo.ico"

# 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,
Expand Down
5 changes: 5 additions & 0 deletions docs/datacollection.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Data Collection
---------------

.. automodule:: datacollection
:members:
Binary file added docs/images/mesa_logo.ico
Binary file not shown.
Binary file added docs/images/mesa_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 18 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ Getting started quickly:
For more help on using Mesa, check out the following resources:

* `Intro to Mesa Tutorial`_
* `Mesa Introductory Tutorial`_
* `Mesa Advanced Tutorial`_
* `Docs`_
* `Email list`_
* `PyPI`_

.. _`Intro to Mesa Tutorial` : http://mesa.readthedocs.org/en/latest/intro-tutorial.html
.. _`Mesa Introductory Tutorial` : http://mesa.readthedocs.org/en/latest/intro_tutorial.html
.. _`Mesa Advanced Tutorial` : http://mesa.readthedocs.org/en/latest/adv_tutorial.html
.. _`Docs` : http://mesa.readthedocs.org/en/latest/
.. _`Email list` : https://groups.google.com/d/forum/projectmesa
.. _`PyPI` : https://pypi.python.org/pypi/Mesa/
Expand All @@ -67,9 +69,21 @@ If you would like to add a feature, please reach out via `ticket`_ or the `email
.. _`Contributors guide` : https://github.com/projectmesa/mesa/blob/master/CONTRIBUTING.rst
.. _`Github` : https://github.com/projectmesa/mesa/
API Documentation
-----------------

.. toctree::
:maxdepth 1

init
batchrunner
datacollection
space
time
visualization

**Table of Contents**
Table of Contents
-----------------

.. toctree::
:maxdepth: 1
Expand All @@ -83,5 +97,4 @@ Indices and tables

* :ref:`genindex`
* :ref:`modindex`
.. * :ref:`search`
* :ref:`search`
5 changes: 5 additions & 0 deletions docs/init.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Base
----

.. automodule:: __init__
:members:
8 changes: 4 additions & 4 deletions docs/intro_tutorial.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

Introduction to Mesa
====================

Introductory Tutorial
---------------------
=====================

Tutorial Description
--------------------

`Mesa <https://github.com/projectmesa/mesa>`__ is a Python framework for
`agent-based
Expand Down
5 changes: 5 additions & 0 deletions docs/space.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Space
-----

.. automodule:: space
:members:
5 changes: 5 additions & 0 deletions docs/time.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Time
----

.. automodule:: time
:members:
4 changes: 1 addition & 3 deletions docs/tutorials/adv_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Introduction to Mesa"
"# Advanced Tutorial"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Advanced Tutorial\n",
"\n",
"### Adding visualization\n",
"\n",
"So far, we've built a model, run it, and analyzed some output afterwards. However, one of the advantages of agent-based models is that we can often watch them run step by step, potentially spotting unexpected patterns, behaviors or bugs, or developing new intuitions, hypotheses, or insights. Other times, watching a model run can explain it to an unfamiliar audience better than static explanations. Like many ABM frameworks, Mesa allows you to create an interactive visualization of the model. In this section we'll walk through creating a visualization using built-in components, and (for advanced users) how to create a new visualization element.\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/intro_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Introduction to Mesa"
"# Introductory Tutorial"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Introductory Tutorial\n",
"## Tutorial Description\n",
"\n",
"[Mesa](https://github.com/projectmesa/mesa) is a Python framework for [agent-based modeling](https://en.wikipedia.org/wiki/Agent-based_model). Getting started with Mesa is easy. In this tutorial, we will walk through creating a simple model and progressively add functionality which will illustrate Mesa's core features.\n",
"\n",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions docs/visualization.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Visualization
-------------

.. automodule:: visualization.__init__
:members:

.. automodule:: visualization.ModularVisualization
:members:

.. automodule:: visualization.TextVisualization
:members:

Modules
~~~~~~~

.. automodule:: visualization.modules.__init__
:members:

.. automodule:: visualization.modules.CanvasGridVisualization
:members:

.. automodule:: visualization.modules.ChartVisualization
:members:

.. automodule:: visualization.modules.TextVisualization
:members:

0 comments on commit 1a86a20

Please sign in to comment.