diff --git a/docs/qe_apidoc.py b/docs/qe_apidoc.py index 197eb935f..520d962ed 100644 --- a/docs/qe_apidoc.py +++ b/docs/qe_apidoc.py @@ -58,24 +58,6 @@ :show-inheritance: """ -model_module_template = """{mod_name} -{equals} - -.. automodule:: quantecon.models.{mod_name} - :members: - :undoc-members: - :show-inheritance: -""" - -solow_model_module_template = """{mod_name} -{equals} - -.. automodule:: quantecon.models.solow.{mod_name} - :members: - :undoc-members: - :show-inheritance: -""" - random_module_template = """{mod_name} {equals} @@ -132,7 +114,6 @@ :maxdepth: 2 markov - models random tools util @@ -170,7 +151,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")): @@ -185,8 +166,8 @@ 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) @@ -194,42 +175,30 @@ def all_auto(): def model_tool(): # 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 ["markov","random","tools","util"]: if not os.path.exists(source_join(folder)): os.makedirs(source_join(folder)) @@ -238,21 +207,7 @@ def model_tool(): 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)) + f.write(markov_module_template.format(mod_name=mod, equals=equals)) # Write file for each random file for mod in random: @@ -280,20 +235,17 @@ def model_tool(): index.write(split_index_template) 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, "tools": tlz, "random":rand, "util":utls, } - for f_name in ("markov","models","random","tools","util"): + for f_name in ("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), diff --git a/docs/source/index.rst b/docs/source/index.rst index 5d5c87bc1..d41452b68 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -16,7 +16,6 @@ econ.net `_. :maxdepth: 2 markov - models random tools util diff --git a/docs/source/util.rst b/docs/source/util.rst index 0d08cd3f2..b4a08b104 100644 --- a/docs/source/util.rst +++ b/docs/source/util.rst @@ -7,5 +7,6 @@ Util util/array util/common_messages util/external + util/notebooks util/random util/timing diff --git a/docs/source/util/notebooks.rst b/docs/source/util/notebooks.rst new file mode 100644 index 000000000..fb1c378d9 --- /dev/null +++ b/docs/source/util/notebooks.rst @@ -0,0 +1,7 @@ +notebooks +========= + +.. automodule:: quantecon.util.notebooks + :members: + :undoc-members: + :show-inheritance: