Skip to content

Commit 0c0d844

Browse files
authored
Merge pull request #1 from MindTheGap-ERC/Add_improve_and_generate_documentation
Add improve and generate documentation
2 parents d07c9bd + 9b8372b commit 0c0d844

File tree

9 files changed

+6218
-6
lines changed

9 files changed

+6218
-6
lines changed

.github/workflows/docs.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: website
2+
3+
# build the documentation whenever there are new commits on main
4+
on:
5+
push:
6+
branches:
7+
- main
8+
# Alternative: only build for tags.
9+
# tags:
10+
# - '*'
11+
12+
# security: restrict permissions for CI jobs.
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
# Build the documentation and upload the static HTML files as an artifact.
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.12'
25+
26+
# install all dependencies (including pdoc)
27+
- run: pip install pipenv
28+
- run: pipenv install
29+
- run: pipenv shell
30+
# build your documentation into docs/.
31+
- run: pdoc marlpde/*.py -o ./docs/
32+
33+
- uses: actions/upload-pages-artifact@v3
34+
with:
35+
path: docs/
36+
37+
# Deploy the artifact to GitHub pages.
38+
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
39+
deploy:
40+
needs: build
41+
runs-on: ubuntu-latest
42+
permissions:
43+
pages: write
44+
id-token: write
45+
environment:
46+
name: github-pages
47+
url: ${{ steps.deployment.outputs.page_url }}
48+
steps:
49+
- id: deployment
50+
uses: actions/deploy-pages@v4

docs/index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="refresh" content="0; url=./marlpde.html"/>
6+
</head>
7+
</html>

docs/marlpde.html

Lines changed: 240 additions & 0 deletions
Large diffs are not rendered by default.

docs/marlpde/Evolve_scenario.html

Lines changed: 816 additions & 0 deletions
Large diffs are not rendered by default.

docs/marlpde/LHeureux_model.html

Lines changed: 3361 additions & 0 deletions
Large diffs are not rendered by default.

docs/marlpde/parameters.html

Lines changed: 1649 additions & 0 deletions
Large diffs are not rendered by default.

docs/search.js

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

marlpde/Evolve_scenario.py

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,54 @@
1717
matplotlib.use("AGG")
1818

1919
def integrate_equations(solver_parms, tracker_parms, pde_parms):
20-
'''
20+
'''Perform the integration and display and store the results.
21+
2122
This function retrieves the parameters of the Scenario to be simulated and
2223
the solution parameters for the integration. It then integrates the five
2324
partial differential equations from L'Heureux, stores and returns the
24-
solution, to be used for plotting.
25+
solution, to be used for plotting. Its inputs come from the parameters
26+
module, which has dataclasses governing the solver, storage and model specs,
27+
through the solver_parms, tracker_parms and pde_parms dicts, respectively.
28+
29+
A progress bar shows how long the (remaining) integration will take.
30+
31+
Parameters:
32+
-----------
33+
solver_parms: dict
34+
Parameters about solver settings.
35+
tracker_parms: dict
36+
Parameters about the progress bar and time interval for storage
37+
pde_parms: dict
38+
Model parameters, which govern e.g. the physical processes, but
39+
also the discretization, such as the number of grid cells.
40+
41+
Returns:
42+
--------
43+
field_solutions: ndarray
44+
This is the "y" attribute of "sol" i.e. the solution derived by
45+
solve_ivp. See the scipy.integrate.solve_ivp documentation for
46+
some background. A reshape has been applied to arrive at one row per
47+
field. The solutions as a function of time have been removed such that
48+
only the solution for the last time is returned.
49+
50+
covered_time: float
51+
This is the time interval of integration in years, from the start time
52+
(probably 0) until the requested final time. When the integration halted
53+
unexpectedly, the covered_time corresponds to the time covered until the
54+
integration halted.
55+
56+
depths: pde.CartesianGrid
57+
These are the centers of the grid cells that together constitute the
58+
grid.
59+
60+
Xstar: float
61+
Scaling factor between physical depths and dimensionless depths as used
62+
in the differential equations.
63+
64+
Store_folder: str
65+
Could be a relative path, i.e. a path relative to the root of this
66+
repository, to a folder where solutions of the integration should be
67+
stored. Could also be an absolute path, though.
2568
'''
2669

2770
Xstar = pde_parms["Xstar"]
@@ -63,7 +106,7 @@ def integrate_equations(solver_parms, tracker_parms, pde_parms):
63106

64107
slices_all_fields = [slice(i * Number_of_depths, (i+1) * Number_of_depths) \
65108
for i in range(5)]
66-
109+
67110
eq = LMAHeureuxPorosityDiff(depths, slices_all_fields, not_too_shallow,
68111
not_too_deep, **filtered_pde_parms)
69112

@@ -149,9 +192,9 @@ def integrate_equations(solver_parms, tracker_parms, pde_parms):
149192
f"{end_computing - start_computing:.2e}s. \n"))
150193

151194
if sol.status == 0:
152-
covered_time = Tstar * end_time
195+
covered_time = Tstar * (end_time - t0)
153196
else:
154-
covered_time = pbar.n * Tstar * end_time / no_progress_updates
197+
covered_time = pbar.n * Tstar * (end_time - t0) / no_progress_updates
155198

156199
# Store your results somewhere in a subdirectory of a parent directory.
157200
store_folder = "../Results/" + \

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors = ["Hanno Spreeuw <[email protected]>", "Johan Hidding <j.hidd
66
license = "Apache-2"
77

88
[tool.poetry.dependencies]
9-
python = ">=3.10,<3.12"
9+
python = ">=3.10,<=3.12"
1010
py-pde = "^0.32.0"
1111
tqdm = "^4.64.1"
1212
numpy = "^1.23.5"

0 commit comments

Comments
 (0)