Skip to content

Commit

Permalink
Merge branch 'master' of github.com:QuantEcon/QuantEcon.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sglyon committed Jan 31, 2016
2 parents abd11b8 + dbb3368 commit efbe114
Show file tree
Hide file tree
Showing 195 changed files with 1,402 additions and 37,593 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
language: python
python:
- 2.7
- 3.3
- 3.5

notifications:
email: false
Expand All @@ -14,7 +14,7 @@ branches:
before_install:
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- ./miniconda.sh -b -p /home/travis/miniconda
- export PATH=/home/travis/miniconda/bin:$PATH
- conda update --yes conda
- sudo rm -rf /dev/shm
Expand All @@ -28,7 +28,7 @@ install:
- cp quantecon/tests/matplotlibrc .

script:
- nosetests --with-coverage --cover-package=quantecon
- nosetests --with-coverage --cover-package=quantecon --exclude=models #quantecon.models excluded from tests to prevent triggering the ImportWarning

after_success:
- coveralls
17 changes: 3 additions & 14 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,15 @@ quantecon/quadsums.py
quantecon/rank_nullspace.py
quantecon/robustlq.py
quantecon/version.py
quantecon/game_theory/__init__.py
quantecon/game_theory/normal_form_game.py
quantecon/markov/__init__.py
quantecon/markov/approximation.py
quantecon/markov/core.py
quantecon/markov/ddp.py
quantecon/markov/gth_solve.py
quantecon/markov/random.py
quantecon/models/__init__.py
quantecon/models/arellano_vfi.py
quantecon/models/asset_pricing.py
quantecon/models/career.py
quantecon/models/ifp.py
quantecon/models/jv.py
quantecon/models/lucastree.py
quantecon/models/odu.py
quantecon/models/optgrowth.py
quantecon/models/uncertainty_traps.py
quantecon/models/solow/__init__.py
quantecon/models/solow/ces.py
quantecon/models/solow/cobb_douglas.py
quantecon/models/solow/impulse_response.py
quantecon/models/solow/model.py
quantecon/random/__init__.py
quantecon/random/utilities.py
quantecon/tests/__init__.py
Expand Down Expand Up @@ -75,5 +63,6 @@ quantecon/util/__init__.py
quantecon/util/array.py
quantecon/util/common_messages.py
quantecon/util/external.py
quantecon/util/notebooks.py
quantecon/util/random.py
quantecon/util/timing.py
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,16 @@ modification, are permitted provided that the following conditions are met:
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

## Major Changes

#### Ver. 0.3.1 (22-January-2016)

1. Adds the ``quantecon/game_theory/`` sub package
2. Updates api for using ``distributions`` as a module ``qe.distributions``

#### Ver. 0.3

1. Removes ``quantecon/models`` subpackage and the collection of code examples. Code has been migrated to the [QuantEcon.applications](https://github.com/QuantEcon/QuantEcon.applications) repository.
2. Adds a utility for fetching notebook dependencies from [QuantEcon.applications](https://github.com/QuantEcon/QuantEcon.applications) to support community contributed notebooks.

99 changes: 38 additions & 61 deletions docs/qe_apidoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
Examples
--------
$ python qe_apidoc.py # generates the two separate directories
$ python qe_apidoc.py foo_bar # generates the two separate directories
$ python qe_apidoc.py foo_bar # generates the two separate directories
$ python qe_apidoc.py single # generates the single directory
Expand Down Expand Up @@ -49,28 +49,19 @@
:show-inheritance:
"""

markov_module_template = """{mod_name}
{equals}
.. automodule:: quantecon.markov.{mod_name}
:members:
:undoc-members:
:show-inheritance:
"""

model_module_template = """{mod_name}
game_theory_module_template = """{mod_name}
{equals}
.. automodule:: quantecon.models.{mod_name}
.. automodule:: quantecon.game_theory.{mod_name}
:members:
:undoc-members:
:show-inheritance:
"""

solow_model_module_template = """{mod_name}
markov_module_template = """{mod_name}
{equals}
.. automodule:: quantecon.models.solow.{mod_name}
.. automodule:: quantecon.markov.{mod_name}
:members:
:undoc-members:
:show-inheritance:
Expand Down Expand Up @@ -119,10 +110,10 @@
=======================
The `quantecon` python library consists of a number of modules which
includes economic models (models), markov chains (markov), random
generation utilities (random), a collection of tools (tools),
and other utilities (util) which are
mainly used by developers internal to the package.
includes economic models (models), markov chains (markov), random
generation utilities (random), a collection of tools (tools),
and other utilities (util) which are
mainly used by developers internal to the package.
The models section, for example, contains implementations of standard
models, many of which are discussed in lectures on the website `quant-
Expand All @@ -131,8 +122,8 @@
.. toctree::
:maxdepth: 2
game_theory
markov
models
random
tools
util
Expand Down Expand Up @@ -170,7 +161,7 @@ def source_join(f_name):
def all_auto():
# Get list of module names
mod_names = glob("../quantecon/[a-z0-9]*.py")
mod_names = map(lambda x: x.split('/')[-1], mod_names)
mod_names = list(map(lambda x: x.split('/')[-1], mod_names))

# Ensure source/modules directory exists
if not os.path.exists(source_join("modules")):
Expand All @@ -185,75 +176,62 @@ def all_auto():

# write index.rst file to include these autogenerated files
with open(source_join("index.rst"), "w") as index:
generated = "\n ".join(map(lambda x: "modules/" + x.split(".")[0],
mod_names))
generated = "\n ".join(list(map(lambda x: "modules/" + x.split(".")[0],
mod_names)))
temp = all_index_template.format(generated=generated)
index.write(temp)


def model_tool():
# list file names with game_theory
game_theory_files = glob("../quantecon/game_theory/[a-z0-9]*.py")
game_theory = list(map(lambda x: x.split('/')[-1][:-3], game_theory_files))
# Alphabetize
game_theory.sort()

# list file names with markov
markov_files = glob("../quantecon/markov/[a-z0-9]*.py")
markov = map(lambda x: x.split('/')[-1][:-3], markov_files)
markov = list(map(lambda x: x.split('/')[-1][:-3], markov_files))
# Alphabetize
markov.sort()

# 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 with models.solow
solow_files = glob("../quantecon/models/solow/[a-z0-9]*.py")
solow = map(lambda x: x.split('/')[-1][:-3], solow_files)
# Alphabetize
solow.sort()

# list file names with random
random_files = glob("../quantecon/random/[a-z0-9]*.py")
random = map(lambda x: x.split('/')[-1][:-3], random_files)
random = list(map(lambda x: x.split('/')[-1][:-3], random_files))
# Alphabetize
random.sort()

# list file names of tools (base level modules)
tool_files = glob("../quantecon/[a-z0-9]*.py")
tools = map(lambda x: x.split('/')[-1][:-3], tool_files)
tools = list(map(lambda x: x.split('/')[-1][:-3], tool_files))
# Alphabetize
tools.remove("version")
tools.sort()

# list file names of utilities
util_files = glob("../quantecon/util/[a-z0-9]*.py")
util = map(lambda x: x.split('/')[-1][:-3], util_files)
util = list(map(lambda x: x.split('/')[-1][:-3], util_files))
# Alphabetize
util.sort()

for folder in ["markov","models","models/solow","random","tools","util"]:
for folder in ["game_theory", "markov", "random", "tools", "util"]:
if not os.path.exists(source_join(folder)):
os.makedirs(source_join(folder))

# Write file for each game_theory file
for mod in game_theory:
new_path = os.path.join("source", "game_theory", mod + ".rst")
with open(new_path, "w") as f:
equals = "=" * len(mod)
f.write(game_theory_module_template.format(mod_name=mod, equals=equals))

# Write file for each markov file
for mod in markov:
new_path = os.path.join("source", "markov", mod + ".rst")
with open(new_path, "w") as f:
equals = "=" * len(mod)
f.write(markov_module_template.format(mod_name=mod, equals=equals))

# Write file for each model
for mod in models:
new_path = os.path.join("source", "models", mod + ".rst")
with open(new_path, "w") as f:
equals = "=" * len(mod)
f.write(model_module_template.format(mod_name=mod, equals=equals))

# Write file for each model.solow
for mod in solow:
new_path = os.path.join("source", "models", "solow", mod + ".rst")
with open(new_path, "w") as f:
equals = "=" * len(mod)
f.write(solow_model_module_template.format(mod_name=mod, equals=equals))

# Write file for each random file
for mod in random:
new_path = os.path.join("source", "random", mod + ".rst")
Expand All @@ -279,21 +257,20 @@ def model_tool():
with open(source_join("index.rst"), "w") as index:
index.write(split_index_template)

gt = "game_theory/" + "\n game_theory/".join(game_theory)
mark = "markov/" + "\n markov/".join(markov)
mods = "models/" + "\n models/".join(models)
mods = mods + "\n solow/" #Add solow sub directory to models
rand = "random/" + "\n random/".join(random)
tlz = "tools/" + "\n tools/".join(tools)
utls = "util/" + "\n util/".join(util)
#-TocTree-#
toc_tree_list = {"markov":mark,
"models": mods,
toc_tree_list = {"game_theory": gt,
"markov": mark,
"tools": tlz,
"random":rand,
"util":utls,
"random": rand,
"util": utls,
}

for f_name in ("markov","models","random","tools","util"):
for f_name in ("game_theory", "markov", "random", "tools", "util"):
with open(source_join(f_name + ".rst"), "w") as f:
temp = split_file_template.format(name=f_name.capitalize(),
equals="="*len(f_name),
Expand Down
7 changes: 7 additions & 0 deletions docs/source/game_theory.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Game_theory
===========

.. toctree::
:maxdepth: 2

game_theory/normal_form_game
7 changes: 7 additions & 0 deletions docs/source/game_theory/normal_form_game.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
normal_form_game
================

.. automodule:: quantecon.game_theory.normal_form_game
:members:
:undoc-members:
:show-inheritance:
10 changes: 5 additions & 5 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ QuantEcon documentation
=======================

The `quantecon` python library consists of a number of modules which
includes economic models (models), markov chains (markov), random
generation utilities (random), a collection of tools (tools),
and other utilities (util) which are
mainly used by developers internal to the package.
includes economic models (models), markov chains (markov), random
generation utilities (random), a collection of tools (tools),
and other utilities (util) which are
mainly used by developers internal to the package.

The models section, for example, contains implementations of standard
models, many of which are discussed in lectures on the website `quant-
Expand All @@ -15,8 +15,8 @@ econ.net <http://quant-econ.net>`_.
.. toctree::
:maxdepth: 2

game_theory
markov
models
random
tools
util
Expand Down
1 change: 1 addition & 0 deletions docs/source/util.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ Util
util/array
util/common_messages
util/external
util/notebooks
util/random
util/timing
7 changes: 7 additions & 0 deletions docs/source/util/notebooks.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
notebooks
=========

.. automodule:: quantecon.util.notebooks
:members:
:undoc-members:
:show-inheritance:
24 changes: 0 additions & 24 deletions examples/3dplot.py

This file was deleted.

Loading

0 comments on commit efbe114

Please sign in to comment.