Skip to content

Commit

Permalink
Merge branch 'master' into i857
Browse files Browse the repository at this point in the history
  • Loading branch information
sbenthall authored Nov 14, 2024
2 parents 7348331 + 894d53e commit b4ec61e
Show file tree
Hide file tree
Showing 129 changed files with 15,876 additions and 5,577 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ jobs:
- name: Run Sphinx
run: >
sphinx-build
-M html Documentation HARK-docs
-M html . HARK-docs
-T
-c Documentation
-W
-j 1
Expand Down
13 changes: 11 additions & 2 deletions Documentation/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,22 @@ For more information on HARK, see [our Github organization](https://github.com/e

Release Date: TBD

#### Major Changes
### Major Changes

- Adds a discretize method to DBlocks and RBlocks (#1460)[https://github.com/econ-ark/HARK/pull/1460]
- Allows structural equations in model files to be provided in string form [#1427](https://github.com/econ-ark/HARK/pull/1427)
- Introduces `HARK.parser' module for parsing configuration files into models [#1427](https://github.com/econ-ark/HARK/pull/1427)
- Allows construction of shocks with arguments based on mathematical expressions [#1464](https://github.com/econ-ark/HARK/pull/1464)
- YAML configuration file for the normalized consumption and portolio choice [#1465](https://github.com/econ-ark/HARK/pull/1465)

#### Minor Changes

- Fixes bug in `AgentPopulation` that caused discretization of distributions to not work. [1275](https://github.com/econ-ark/HARK/pull/1275)
- Adds support for distributions, booleans, and callables as parameters in the `Parameters` class. [1387](https://github.com/econ-ark/HARK/pull/1387)
- Removes a specific way of accounting for ``employment'' in the idiosyncratic-shocks income process. [1473](https://github.com/econ-ark/HARK/pull/1473)
- Changes the behavior of make_lognormal_RiskyDstn so that the standard deviation represents the standard deviation of log(returns)
- Adds detailed parameter and latex documentation to most models.
- Add PermGroFac constructor that explicitly combines idiosyncratic and aggregate sources of growth. [1489](https://github.com/econ-ark/HARK/pull/1489)

### 0.15.1

Expand Down Expand Up @@ -58,7 +66,8 @@ This release drops support for Python 3.8 and 3.9, consistent with SPEC 0, and a

#### Minor Changes

- Add option to pass pre-built grid to `LinearFast`. [#1388](https://github.com/econ-ark/HARK/pull/1388)

- Add option to pass pre-built grid to `LinearFast`. [1388](https://github.com/econ-ark/HARK/pull/1388)
- Moves calculation of stable points out of ConsIndShock solver, into method called by post_solve [#1349](https://github.com/econ-ark/HARK/pull/1349)
- Adds cubic spline interpolation and value function construction to "warm glow bequest" models.
- Fixes cubic spline interpolation for ConsMedShockModel.
Expand Down
1 change: 1 addition & 0 deletions Documentation/Style.tex.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HARK/Documentation/NARK/@resources/texlive/texmf-local/tex/latex/tex4ht HARK/Documentation/NARK/@resources/texlive/texmf-local/tex/latex/econark-make4ht.sty HARK/Documentation/NARK/@resources/texlive/texmf-local/tex/latex/econark-multibib.sty HARK/Documentation/NARK/@resources/texlive/texmf-local/tex/latex/econark-onlyinsubfile.sty HARK/Documentation/NARK/@resources/texlive/texmf-local/tex/latex/econark-titlepage.sty HARK/Documentation/NARK/@resources/texlive/texmf-local/tex/latex/econark.cls HARK/Documentation/NARK/@resources/texlive/texmf-local/tex/latex/econark.sty HARK/Documentation/NARK/@resources/texlive/texmf-local/tex/latex/llorracc-handouts.sty HARK/Documentation/NARK/@resources/texlive/texmf-local/tex/latex/pdfsuppressruntime.sty HARK/Documentation/NARK/@resources/texlive/texmf-local/tex/latex/README.md
3 changes: 0 additions & 3 deletions Documentation/_static/override-nbsphinx-gallery.css

This file was deleted.

44 changes: 34 additions & 10 deletions Documentation/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import warnings
from datetime import date
import os

dir = os.path.dirname(__file__)

try:
import numba
Expand Down Expand Up @@ -41,13 +44,32 @@
"sphinx_design",
]

include_patterns = [
"Documentation**",
"index.rst",
] # Makes sure that only the file we want documented get documented
with open(os.path.join(dir, "example_notebooks", "Include_list.txt"), "r") as file:
include_patterns += file.readlines()
include_patterns = [
i.replace("\n", "") for i in include_patterns
] # Adds example notebooks

exclude_patterns = [
"_build",
"Thumbs.db",
".DS_Store",
"NARK",
"Documentation/_build",
"Documentation/Thumbs.db",
"Documentation/.DS_Store",
"Documentation/NARK",
"Documentation/index_core.rst", # Prevents sphinx from getting confused
]

napoleon_custom_sections = [
("Variables associated with the default constuctor", "params_style"),
("Grid Parameters", "params_style"),
("Solving Parameters", "params_style"),
("Simulation Parameters", "params_style"),
("Constructors", "params_style"),
("Attributes", "returns_style"),
]
language = "en"

master_doc = "index"
Expand All @@ -64,11 +86,8 @@

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

html_static_path = []
html_css_files = ["override-nbsphinx-gallery.css"]
html_theme_options = {
"use_edit_page_button": True,
"icon_links": [
Expand Down Expand Up @@ -105,7 +124,7 @@
}

nbsphinx_prolog = r"""
{% set docname = 'Documentation/' + env.doc2path(env.docname, base=None) %}
{% set docname = env.doc2path(env.docname, base=None) %}
.. raw:: html
Expand Down Expand Up @@ -149,8 +168,13 @@
# sphinx.ext.autosummary configuration
autosummary_generate = True

# Orders functions by the source order
autodoc_member_order = "bysource"

# sphinx.ext.napoleon configuration
napoleon_use_ivar = True # solves duplicate object description warning

# nbsphinx configuration
nbsphinx_execute = "never" # notebooks are executed via ``nb_exec.py``

suppress_warnings = []
1 change: 0 additions & 1 deletion Documentation/example_notebooks/ConsPortfolioModel.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion Documentation/example_notebooks/GenIncProcessModel.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion Documentation/example_notebooks/GenIncProcessModel.py

This file was deleted.

1 change: 0 additions & 1 deletion Documentation/example_notebooks/Gentle-Intro-To-HARK.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion Documentation/example_notebooks/HARK-struct-2.png

This file was deleted.

1 change: 0 additions & 1 deletion Documentation/example_notebooks/HARK-struct-3.png

This file was deleted.

1 change: 0 additions & 1 deletion Documentation/example_notebooks/HARK-struct-4.png

This file was deleted.

This file was deleted.

14 changes: 14 additions & 0 deletions Documentation/example_notebooks/Include_list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
examples/Gentle-Intro/Gentle-Intro-To-HARK.ipynb
examples/LifecycleModel/Cycles_tutorial.ipynb
examples/ConsIndShockModel/PerfForesightConsumerType.ipynb
examples/ConsIndShockModel/IndShockConsumerType.ipynb
examples/ConsIndShockModel/KinkedRconsumerType.ipynb
examples/ConsPortfolioModel/example_ConsPortfolioModel.ipynb
examples/GenIncProcessModel/GenIncProcessModel.ipynb
examples/LifecycleModel/LifecycleModel.ipynb
examples/HowWeSolveIndShockConsumerType/HowWeSolveIndShockConsumerType.ipynb
examples/Journeys/Journey-PhD.ipynb
examples/ConsNewKeynesianModel/Transition_Matrix_Example.ipynb
examples/ConsNewKeynesianModel/Jacobian_Example.ipynb
examples/ConsNewKeynesianModel/KS-HARK-presentation.ipynb
examples/ConsNewKeynesianModel/SSJ_example.ipynb
1 change: 0 additions & 1 deletion Documentation/example_notebooks/IndShockConsumerType.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion Documentation/example_notebooks/Journey-PhD.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion Documentation/example_notebooks/JourneyPhDparam.py

This file was deleted.

1 change: 0 additions & 1 deletion Documentation/example_notebooks/KinkedRconsumerType.ipynb

This file was deleted.

1 change: 0 additions & 1 deletion Documentation/example_notebooks/LifecycleModel.ipynb

This file was deleted.

This file was deleted.

36 changes: 33 additions & 3 deletions Documentation/guides/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,43 @@ To test your changes to the documentation locally, you can render as follows:
2. Run `sphinx-build`:
```bash
sphinx-build -M html Documentation HARK-docs -T -W
```
```bash
sphinx-build -M html . HARK-docs -T -c Documentation -W
```
3. View the rendered HTML by opening the
`./HARK-docs/html/index.html` file.
#### Adding examples to the documentation
HARK's example notebooks are stored in the HARK/examples file.
Every pull request to HARK automatically reruns every example notebook
to keep them up to date.

To add a notebook from the examples folder to the documentation, add a link
to the notebook to the `Documentation/overview/index.rst` file. It should
the format `../../examples/AAA/BBB.ipynb`. Then add a link to the notebook
in the `Documentation/example_notebooks/Include_list.txt` file. It should have
the format `examples/AAA/BBB.ipynb`.

Sphinx requires it's example notebooks to have a title, and headings in order of
decreasing size. Make sure the notebook you added has those qualities before you push.
Otherwise sphinx will fail to build.
:::{warning}
Make sure not to include the HARK-docs folder in your pull request if you're
testing locally. HARK will automatically build this file when the pull request
is made. Including the HARK-docs folder may create unexpected conflicts.

If you would like to build the documentation without warnings being treated as errors use the command:
```bash
sphinx-build -M html . HARK-docs -T -c Documentation
```
This lets you see every warning without sphinx quitting after the first issue it finds.
If you're doing this, make sure to delete the HARK-docs folder before running it again.
Otherwise it won't show the warnings again, and you won't be able to check if they've been fixed.
:::

### Testing

`HARK` has a test suite that ensures correct
Expand Down
Loading

0 comments on commit b4ec61e

Please sign in to comment.