Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a gallery for the example notebooks #1321

Merged
merged 4 commits into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Documentation/_static/override-nbsphinx-gallery.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.nbsphinx-gallery {
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
4 changes: 4 additions & 0 deletions Documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@

# HTML writer configuration
html_theme = "pydata_sphinx_theme"
html_static_path = ["_static"]
html_css_files = [
'override-nbsphinx-gallery.css',
]

html_theme_options = {
"use_edit_page_button": True,
Expand Down
5 changes: 4 additions & 1 deletion Documentation/overview/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ Overview
introduction
ARKitecture

.. toctree::
.. nbgallery is a wrapper around the toctree directive, see
https://nbsphinx.readthedocs.io/en/latest/a-normal-rst-file.html#thumbnail-galleries

.. nbgallery::
:caption: Examples
:maxdepth: 1

Expand Down
5 changes: 3 additions & 2 deletions examples/ConsIndShockModel/IndShockConsumerType.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# IndShockConsumerType Documentation\n",
"## Consumption-Saving model with Idiosyncratic Income Shocks"
"# Consumption-Saving model with Idiosyncratic Income Shocks\n",
"\n",
"**The `IndShockConsumerType` class**"
]
},
{
Expand Down
4 changes: 3 additions & 1 deletion examples/ConsIndShockModel/KinkedRconsumerType.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"lines_to_next_cell": 2
},
"source": [
"# KinkedRconsumerType: Consumption-saving model with idiosyncratic income shocks and different interest rates on borrowing and saving"
"# Consumption-Saving model with Idiosyncratic Income Shocks and Different Interest Rates on Borrowing and Saving\n",
"\n",
"**The `KinkedRconsumerType` class**"
]
},
{
Expand Down
4 changes: 3 additions & 1 deletion examples/ConsIndShockModel/PerfForesightConsumerType.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"lines_to_next_cell": 2
},
"source": [
"# PerfForesightConsumerType: Perfect foresight consumption-saving"
"# Perfect foresight consumption-saving\n",
"\n",
"**The `PerfForesightConsumerType` class**"
]
},
{
Expand Down
10 changes: 9 additions & 1 deletion examples/Gentle-Intro/Gentle-Intro-To-HARK.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,15 @@
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"metadata": {
"execution": {
"iopub.execute_input": "2023-02-07T00:50:32.939429Z",
"iopub.status.busy": "2023-02-07T00:50:32.939429Z",
"iopub.status.idle": "2023-02-07T00:50:33.094965Z",
"shell.execute_reply": "2023-02-07T00:50:33.094965Z"
},
"nbsphinx-thumbnail": {}
},
"outputs": [
{
"data": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# How we solve a model defined by the `IndShockConsumerType` class\n",
"# How we solve a model defined by `IndShockConsumerType`\n",
"\n",
"The IndShockConsumerType reprents the work-horse consumption savings model with temporary and permanent shocks to income, finite or infinite horizons, CRRA utility and more. In this DemARK we take you through the steps involved in solving one period of such a model. The inheritance chains can be a little long, so figuring out where all the parameters and methods come from can be a bit confusing. Hence this map! The intention is to make it easier to know how to inheret from IndShockConsumerType in the sense that you know where to look for specific solver logic, but also so you know can figure out which methods to overwrite or supplement in your own `AgentType` and solver!\n",
"## The `solveConsIndShock` function\n",
"In HARK, a period's problem is always solved by the callable (function or callable object instance) stored in the field `solve_one_period`. In the case of `IndShockConsumerType`, this function is called `solveConsIndShock`. The function accepts a number of arguments, that it uses to construct an instance of either a `ConsIndShockSolverBasic` or a `ConsIndShockSolver`. These solvers both have the methods `prepare_to_solve` and `solve`, that we will have a closer look at in this notebook. This means, that the logic of `solveConsIndShock` is basically:\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/LifecycleModel/LifecycleModel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"metadata": {},
"source": [
"\n",
"# A Lifecycle Model: The Distribution of Assets By Age\n",
"# A Life Cycle Model: The Distribution of Assets By Age\n",
"\n",
"National registry data on income and wealth from Scandinavian countries has recently become available (with a lot of security) to some (lucky!) researchers. These data offer a uniquely powerful tool for testing (and improving) our models of consumption and saving behavior over the life cycle.\n",
"\n",
Expand Down