Permalink
Browse files

DOC: fixed readthedocs

  • Loading branch information...
1 parent dc8d5b0 commit f23a4b59d3c8b439e7a5070608d58011c485a413 @sglyon sglyon committed Oct 6, 2014
View
@@ -1,2 +1,2 @@
service_name: travis-ci
-repo_token: jsCc4k6kaFJLjBQVv9tpwK5ujJMh8sZxc
+repo_token: 7f8JDNk6BsPMESy0URL3W00zlazzRcuzR
View
@@ -37,8 +37,8 @@ Assuming you have [pip](https://pypi.python.org/pypi/pip) on your computer --- a
at a terminal prompt
#### Current Build and Coverage Status:
-[![Build Status](https://travis-ci.org/jstac/quant-econ.svg?branch=master)](https://travis-ci.org/jstac/quant-econ)
-[![Coverage Status](https://coveralls.io/repos/jstac/quant-econ/badge.png)](https://coveralls.io/r/jstac/quant-econ)
+[![Build Status](https://travis-ci.org/QuantEcon/QuantEcon.py.svg?branch=master)](https://travis-ci.org/QuantEcon/QuantEcon.py)
+[![Coverage Status](https://coveralls.io/repos/QuantEcon/QuantEcon.py/badge.png)](https://coveralls.io/r/QuantEcon/QuantEcon.py)
### About Git / GitHub
View
@@ -64,6 +64,7 @@ myhtml:
make html
html:
+ python qe_apidoc.py
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
View
@@ -48,6 +48,15 @@
:show-inheritance:
"""
+model_module_template = """{mod_name}
+{equals}
+
+.. automodule:: quantecon.models.{mod_name}
+ :members:
+ :undoc-members:
+ :show-inheritance:
+"""
+
all_index_template = """=======================
QuantEcon documentation
=======================
@@ -108,29 +117,6 @@
def source_join(f_name):
return os.path.join("source", f_name)
-
-def gen_module(name, f):
- """
- Generate the template for a particular module by writing to the
- file f. There are no return values.
-
- Parameters
- ----------
- name : string
- The name of the python module within quantecon to document
-
- Examples
- --------
- >>> with open("my_new_file.rst", "w") as f:
- ... gen_module(my_new_module, f)
-
- """
- # Define template for auto-generated docs
-
- equals = "=" * len(name)
- f.write(module_template.format(mod_name=name, equals=equals))
-
-
####################
## Main functions ##
####################
@@ -164,10 +150,14 @@ def model_tool():
# list file names with models
mod_files = glob("../quantecon/models/[a-z0-9]*.py")
models = map(lambda x: x.split('/')[-1][:-3], mod_files)
+ # Alphabetize
+ models.sort()
# list file names of tools
tool_files = glob("../quantecon/[a-z0-9]*.py")
tools = map(lambda x: x.split('/')[-1][:-3], tool_files)
+ # Alphabetize
+ tools.sort()
for folder in ["models", "tools"]:
if not os.path.exists(source_join(folder)):
@@ -177,13 +167,15 @@ def model_tool():
for mod in models:
new_path = os.path.join("source", "models", mod + ".rst")
with open(new_path, "w") as f:
- gen_module(mod, f)
+ equals = "=" * len(mod)
+ f.write(model_module_template.format(mod_name=mod, equals=equals))
# Write file for each tool
for mod in tools:
new_path = os.path.join("source", "tools", mod + ".rst")
with open(new_path, "w") as f:
- gen_module(mod, f)
+ equals = "=" * len(mod)
+ f.write(module_template.format(mod_name=mod, equals=equals))
# write (index|models|tools).rst file to include autogenerated files
with open(source_join("index.rst"), "w") as index:
View
@@ -14,7 +14,30 @@
import sys
import os
+import pip
+try:
+ from mock import Mock as MagicMock
+except ImportError:
+ def install(package):
+ pip.main(['install', package])
+
+ install('mock')
+ from mock import Mock as MagicMock
+
+# ------------------------------------------------------------------- #
+# MOCK MODULES
+# ------------------------------------------------------------------- #
+on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+
+if on_rtd:
+ class Mock(MagicMock):
+ @classmethod
+ def __getattr__(cls, name):
+ return Mock()
+
+ MOCK_MODULES = ['pandas', 'statsmodels', 'sympy', "sympy.mpmath", 'numba']
+ sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
# 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
@@ -1,7 +1,7 @@
asset_pricing
=============
-.. automodule:: quantecon.asset_pricing
+.. automodule:: quantecon.models.asset_pricing
:members:
:undoc-members:
:show-inheritance:
@@ -1,7 +1,7 @@
career
======
-.. automodule:: quantecon.career
+.. automodule:: quantecon.models.career
:members:
:undoc-members:
:show-inheritance:
@@ -1,7 +1,7 @@
ifp
===
-.. automodule:: quantecon.ifp
+.. automodule:: quantecon.models.ifp
:members:
:undoc-members:
:show-inheritance:
@@ -1,7 +1,7 @@
jv
==
-.. automodule:: quantecon.jv
+.. automodule:: quantecon.models.jv
:members:
:undoc-members:
:show-inheritance:
@@ -1,7 +1,7 @@
lucastree
=========
-.. automodule:: quantecon.lucastree
+.. automodule:: quantecon.models.lucastree
:members:
:undoc-members:
:show-inheritance:
@@ -1,7 +1,7 @@
odu
===
-.. automodule:: quantecon.odu
+.. automodule:: quantecon.models.odu
:members:
:undoc-members:
:show-inheritance:
@@ -1,7 +1,7 @@
optgrowth
=========
-.. automodule:: quantecon.optgrowth
+.. automodule:: quantecon.models.optgrowth
:members:
:undoc-members:
:show-inheritance:
@@ -4,20 +4,25 @@ Tools
.. toctree::
:maxdepth: 2
+ tools/arma
+ tools/cartesian
tools/ce_util
tools/compute_fp
tools/discrete_rv
+ tools/distributions
tools/ecdf
tools/estspec
+ tools/ivp
tools/kalman
tools/lae
- tools/linproc
tools/lqcontrol
+ tools/lqnash
tools/lss
+ tools/matrix_eqn
tools/mc_tools
tools/quad
tools/quadsums
tools/rank_nullspace
- tools/riccati
tools/robustlq
tools/tauchen
+ tools/version
@@ -1,7 +1,7 @@
-riccati
-=======
+arma
+====
-.. automodule:: quantecon.riccati
+.. automodule:: quantecon.arma
:members:
:undoc-members:
:show-inheritance:
@@ -0,0 +1,7 @@
+cartesian
+=========
+
+.. automodule:: quantecon.cartesian
+ :members:
+ :undoc-members:
+ :show-inheritance:
@@ -0,0 +1,7 @@
+distributions
+=============
+
+.. automodule:: quantecon.distributions
+ :members:
+ :undoc-members:
+ :show-inheritance:
@@ -0,0 +1,7 @@
+ivp
+===
+
+.. automodule:: quantecon.ivp
+ :members:
+ :undoc-members:
+ :show-inheritance:
@@ -0,0 +1,7 @@
+lqnash
+======
+
+.. automodule:: quantecon.lqnash
+ :members:
+ :undoc-members:
+ :show-inheritance:
@@ -0,0 +1,7 @@
+matrix_eqn
+==========
+
+.. automodule:: quantecon.matrix_eqn
+ :members:
+ :undoc-members:
+ :show-inheritance:
@@ -1,7 +1,7 @@
-linproc
+version
=======
-.. automodule:: quantecon.linproc
+.. automodule:: quantecon.version
:members:
:undoc-members:
:show-inheritance:
@@ -0,0 +1,13 @@
+# These are the required packages for the quant-econ package to build
+
+Sphinx
+
+ipython
+
+numpy
+
+numpydoc
+
+scipy
+
+matplotlib

0 comments on commit f23a4b5

Please sign in to comment.