Skip to content

Commit c8b25d8

Browse files
committed
Upddate documentation
1 parent 70f31a5 commit c8b25d8

28 files changed

Lines changed: 599 additions & 390 deletions

.github/workflows/docs.yml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,43 @@ jobs:
2727
python-version: '3.8'
2828

2929
- name: Install dependencies
30-
run: pip install -r docs/requirements.txt
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install -r docs/requirements.txt
3133
32-
- name: Build Sphinx docs
34+
- name: Build Sphinx HTML (warnings are errors)
3335
run: |
3436
cd docs
35-
make clean
36-
make html
37+
sphinx-build -b html -W --keep-going source _build/html
3738
3839
- name: Upload artifact
3940
uses: actions/upload-pages-artifact@v3
4041
with:
4142
path: docs/_build/html/
4243

44+
linkcheck:
45+
if: github.event_name == 'pull_request'
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v4
49+
50+
- name: Set up Python
51+
uses: actions/setup-python@v5
52+
with:
53+
python-version: '3.8'
54+
55+
- name: Install dependencies
56+
run: |
57+
python -m pip install --upgrade pip
58+
pip install -r docs/requirements.txt
59+
60+
- name: Run linkcheck (warnings are errors)
61+
run: |
62+
cd docs
63+
sphinx-build -b linkcheck -W --keep-going source _build/linkcheck
64+
4365
deploy:
44-
if: github.ref == 'refs/heads/master'
66+
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
4567
needs: build
4668
runs-on: ubuntu-latest
4769
environment:

docs/requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
sphinx>=5.0
2-
pydata-sphinx-theme>=0.14
3-
myst-parser>=0.18
4-
nbsphinx>=0.9
5-
sphinxcontrib-bibtex>=2.5
6-
sphinx-copybutton
1+
sphinx>=7.0,<8.0
2+
pydata-sphinx-theme>=0.14,<0.16
3+
myst-parser>=2.0,<3.0
4+
nbsphinx>=0.9,<0.10
5+
sphinxcontrib-bibtex>=2.6,<3.0
6+
sphinx-copybutton>=0.5,<0.6

docs/source/_static/custom.css

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,37 @@
1616
.bd-sidebar-primary {
1717
border-right: 1px solid var(--pst-color-border);
1818
}
19+
20+
/* Keep the primary sidebar visible and sticky on desktop */
21+
@media (min-width: 992px) {
22+
.bd-sidebar-primary {
23+
display: block !important;
24+
visibility: visible !important;
25+
transform: none !important;
26+
margin-left: 0 !important;
27+
position: sticky;
28+
top: calc(var(--pst-header-height) + 0.5rem);
29+
max-height: calc(100vh - var(--pst-header-height) - 1rem);
30+
overflow-y: auto;
31+
}
32+
33+
body:not(.primary-sidebar-open) .bd-sidebar-primary {
34+
margin-left: 0 !important;
35+
}
36+
}
37+
38+
/* Improve long-form readability */
39+
.bd-content .bd-article {
40+
line-height: 1.65;
41+
}
42+
43+
.bd-content .bd-article h1,
44+
.bd-content .bd-article h2,
45+
.bd-content .bd-article h3 {
46+
letter-spacing: 0.01em;
47+
}
48+
49+
/* Make admonitions slightly easier to scan */
50+
.bd-content .admonition {
51+
border-radius: 0.4rem;
52+
}

docs/source/api/building.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ Building
33

44
Core agent-based model: household behavior, renovation decisions, and heating system choices.
55

6+
When to use this module
7+
-----------------------
8+
9+
Use ``project.building`` when you need to inspect or extend behavior at dwelling and agent level, including:
10+
11+
- renovation choice logic
12+
- heating-system switching behavior
13+
- stock state transitions on the agent side
14+
15+
Main classes are exposed through ``ThermalBuildings`` and ``AgentBuildings``.
16+
617
.. automodule:: project.building
718
:members:
819
:undoc-members:

docs/source/api/coupling.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ Coupling
33

44
Scenario coupling logic for integrated policy analysis.
55

6+
When to use this module
7+
-----------------------
8+
9+
Use ``project.coupling`` for multi-run workflows where Res-IRF outputs are reused as inputs for iterative or linked analyses.
10+
611
.. automodule:: project.coupling
712
:members:
813
:undoc-members:

docs/source/api/dynamic.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ Dynamic
33

44
Exogenous dynamics: stock needs, construction flows, and housing type transitions.
55

6+
When to use this module
7+
-----------------------
8+
9+
Use ``project.dynamic`` when working with:
10+
11+
- population-to-stock transformations
12+
- construction need projections
13+
- housing-type and surface evolution rules
14+
615
.. automodule:: project.dynamic
716
:members:
817
:undoc-members:

docs/source/api/model.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ Model
33

44
Main simulation engine: initialization, calibration, and scenario execution.
55

6+
When to use this module
7+
-----------------------
8+
9+
Use ``project.model`` when you need to:
10+
11+
- prepare scenario configurations before execution
12+
- initialize model state from parsed inputs
13+
- run a full simulation programmatically
14+
15+
Common entrypoints include ``prepare_config`` and ``res_irf``.
16+
617
.. automodule:: project.model
718
:members:
819
:undoc-members:

docs/source/api/read_input.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ Read Input
33

44
Data loading and policy parsing: reads configuration files, building stock data, and policy definitions.
55

6+
When to use this module
7+
-----------------------
8+
9+
Use ``project.read_input`` for:
10+
11+
- reading stock, macro, and technical inputs
12+
- parsing policy definitions into internal objects
13+
- transforming raw tables into model-ready structures
14+
15+
This module also defines policy object abstractions used across the run pipeline.
16+
617
.. automodule:: project.read_input
718
:members:
819
:undoc-members:

docs/source/api/runs.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ Runs
33

44
Scenario execution utilities.
55

6+
When to use this module
7+
-----------------------
8+
9+
Use ``project.runs`` to execute a directory of configuration files in batch mode from the CLI.
10+
611
.. automodule:: project.runs
712
:members:
813
:undoc-members:

docs/source/api/thermal.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ Thermal
33

44
Thermal building calculations: energy performance, heat loss, and EPC classification.
55

6+
When to use this module
7+
-----------------------
8+
9+
Use ``project.thermal`` for:
10+
11+
- conventional and actual energy-use calculations
12+
- EPC/certificate assignment helpers
13+
- heating-intensity and thermal-physics utility functions
14+
615
.. automodule:: project.thermal
716
:members:
817
:undoc-members:

0 commit comments

Comments
 (0)