Skip to content

Commit

Permalink
Merge pull request #35 from jessegrabowski/docs
Browse files Browse the repository at this point in the history
Add sphinx docs
  • Loading branch information
jessegrabowski authored Jun 30, 2024
2 parents 39c71db + 80f8e9c commit 438b092
Show file tree
Hide file tree
Showing 44 changed files with 632 additions and 42 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/rtd-link-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Read the Docs Pull Request Preview
on:
pull_request_target:
types:
- opened

permissions:
pull-requests: write

jobs:
documentation-links:
runs-on: ubuntu-latest
steps:
- uses: readthedocs/actions/preview@v1
with:
project-slug: "gEconpy"
4 changes: 2 additions & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.9"]
python-version: ["3.12"]
test-subset:
- |
tests/
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
activate-environment: geconpy-test
channel-priority: strict
environment-file: conda_envs/geconpy_test.yml
python-version: 3.9
python-version: 3.12
use-mamba: true
use-only-tar-bz2: false # IMPORTANT: This may break caching of conda packages! See https://github.com/conda-incubator/setup-miniconda/issues/267

Expand Down
2 changes: 2 additions & 0 deletions .jupytext.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
notebook_metadata_filter = "myst,-jupytext.text_representation.jupytext_version"
formats = ["ipynb", ".myst.md:myst"]
13 changes: 13 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 1

sphinx:
configuration: docs/source/conf.py

build:
os: ubuntu-22.04
tools:
python: "3.11"

python:
install:
- requirements: requirements-docs.txt
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
4 changes: 4 additions & 0 deletions docs/source/about.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
About gEconpy
=============

WRITEME
9 changes: 9 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. _api:

API
===

.. toctree::
:maxdepth: 1

api/base
9 changes: 9 additions & 0 deletions docs/source/api/base.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
DSGE Modeling
*************

.. automodule:: gEconpy.classes

.. toctree::
:maxdepth: 1

base/classes
20 changes: 20 additions & 0 deletions docs/source/api/base/classes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
DSGE Model
----------

.. currentmodule:: gEconpy.classes.model

.. autosummary::
:toctree: generated/

gEconModel


Model Components
----------------

.. currentmodule:: gEconpy.classes.block

.. autosummary::
:toctree: generated/

Block
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gEconpy.classes.block.Block.\_\_init\_\_
========================================

.. currentmodule:: gEconpy.classes.block

.. automethod:: Block.__init__
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gEconpy.classes.block.Block.initialize\_from\_dictionary
========================================================

.. currentmodule:: gEconpy.classes.block

.. automethod:: Block.initialize_from_dictionary
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gEconpy.classes.block.Block.simplify\_system\_equations
=======================================================

.. currentmodule:: gEconpy.classes.block

.. automethod:: Block.simplify_system_equations
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gEconpy.classes.block.Block.solve\_optimization
===============================================

.. currentmodule:: gEconpy.classes.block

.. automethod:: Block.solve_optimization
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gEconpy.classes.model.gEconModel.\_\_init\_\_
=============================================

.. currentmodule:: gEconpy.classes.model

.. automethod:: gEconModel.__init__
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gEconpy.classes.model.gEconModel.build
======================================

.. currentmodule:: gEconpy.classes.model

.. automethod:: gEconModel.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gEconpy.classes.model.gEconModel.build\_report
==============================================

.. currentmodule:: gEconpy.classes.model

.. automethod:: gEconModel.build_report
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gEconpy.classes.model.gEconModel.check\_bk\_condition
=====================================================

.. currentmodule:: gEconpy.classes.model

.. automethod:: gEconModel.check_bk_condition
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gEconpy.classes.model.gEconModel.compute\_autocorrelation\_matrix
=================================================================

.. currentmodule:: gEconpy.classes.model

.. automethod:: gEconModel.compute_autocorrelation_matrix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gEconpy.classes.model.gEconModel.compute\_stationary\_covariance\_matrix
========================================================================

.. currentmodule:: gEconpy.classes.model

.. automethod:: gEconModel.compute_stationary_covariance_matrix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gEconpy.classes.model.gEconModel.fit
====================================

.. currentmodule:: gEconpy.classes.model

.. automethod:: gEconModel.fit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gEconpy.classes.model.gEconModel.impulse\_response\_function
============================================================

.. currentmodule:: gEconpy.classes.model

.. automethod:: gEconModel.impulse_response_function
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gEconpy.classes.model.gEconModel.print\_steady\_state
=====================================================

.. currentmodule:: gEconpy.classes.model

.. automethod:: gEconModel.print_steady_state
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gEconpy.classes.model.gEconModel.sample\_param\_dict\_from\_prior
=================================================================

.. currentmodule:: gEconpy.classes.model

.. automethod:: gEconModel.sample_param_dict_from_prior
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gEconpy.classes.model.gEconModel.simulate
=========================================

.. currentmodule:: gEconpy.classes.model

.. automethod:: gEconModel.simulate
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gEconpy.classes.model.gEconModel.solve\_model
=============================================

.. currentmodule:: gEconpy.classes.model

.. automethod:: gEconModel.solve_model
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gEconpy.classes.model.gEconModel.steady\_state
==============================================

.. currentmodule:: gEconpy.classes.model

.. automethod:: gEconModel.steady_state
20 changes: 20 additions & 0 deletions docs/source/api/base/generated/gEconpy.classes.block.Block.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
gEconpy.classes.block.Block
===========================

.. currentmodule:: gEconpy.classes.block

.. autoclass:: Block




.. rubric:: Methods

.. autosummary::
:toctree: classmethods


Block.__init__
Block.initialize_from_dictionary
Block.simplify_system_equations
Block.solve_optimization
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
gEconpy.classes.model.gEconModel
================================

.. currentmodule:: gEconpy.classes.model

.. autoclass:: gEconModel




.. rubric:: Methods

.. autosummary::
:toctree: classmethods


gEconModel.__init__
gEconModel.build
gEconModel.build_report
gEconModel.check_bk_condition
gEconModel.compute_autocorrelation_matrix
gEconModel.compute_stationary_covariance_matrix
gEconModel.fit
gEconModel.impulse_response_function
gEconModel.print_steady_state
gEconModel.sample_param_dict_from_prior
gEconModel.simulate
gEconModel.solve_model
gEconModel.steady_state
Loading

0 comments on commit 438b092

Please sign in to comment.