sadiepy 0.0.1.dev0__tar.gz → 0.0.2.dev0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sadiepy-0.0.1.dev0 → sadiepy-0.0.2.dev0}/.github/workflows/ci.yml +13 -0
- sadiepy-0.0.2.dev0/.github/workflows/release.yml +58 -0
- {sadiepy-0.0.1.dev0 → sadiepy-0.0.2.dev0}/.gitignore +7 -0
- sadiepy-0.0.2.dev0/.readthedocs.yaml +18 -0
- sadiepy-0.0.2.dev0/CHANGELOG.md +57 -0
- {sadiepy-0.0.1.dev0 → sadiepy-0.0.2.dev0}/CITATION.cff +2 -1
- {sadiepy-0.0.1.dev0 → sadiepy-0.0.2.dev0}/PKG-INFO +60 -2
- {sadiepy-0.0.1.dev0 → sadiepy-0.0.2.dev0}/README.md +49 -1
- sadiepy-0.0.2.dev0/docs/api/index.md +36 -0
- sadiepy-0.0.2.dev0/docs/conf.py +60 -0
- sadiepy-0.0.2.dev0/docs/examples/01_quickstart.ipynb +2738 -0
- sadiepy-0.0.2.dev0/docs/examples/02_tour.ipynb +1227 -0
- sadiepy-0.0.2.dev0/docs/examples/index.md +11 -0
- sadiepy-0.0.2.dev0/docs/index.md +31 -0
- sadiepy-0.0.2.dev0/docs/theory.md +871 -0
- {sadiepy-0.0.1.dev0 → sadiepy-0.0.2.dev0}/pyproject.toml +17 -3
- sadiepy-0.0.2.dev0/refs/README.md +14 -0
- sadiepy-0.0.2.dev0/src/sadiepy/__init__.py +32 -0
- sadiepy-0.0.2.dev0/src/sadiepy/core/drag.py +379 -0
- sadiepy-0.0.2.dev0/src/sadiepy/core/solver.py +427 -0
- sadiepy-0.0.2.dev0/src/sadiepy/core/vegetation.py +332 -0
- sadiepy-0.0.2.dev0/src/sadiepy/core/waves.py +427 -0
- sadiepy-0.0.2.dev0/src/sadiepy/presets/__init__.py +11 -0
- sadiepy-0.0.2.dev0/src/sadiepy/presets/generic.py +39 -0
- sadiepy-0.0.2.dev0/src/sadiepy/presets/zhang2023.py +339 -0
- sadiepy-0.0.2.dev0/src/sadiepy/scaling/froude.py +207 -0
- sadiepy-0.0.2.dev0/src/sadiepy/units.py +194 -0
- sadiepy-0.0.2.dev0/src/sadiepy/warnings.py +25 -0
- sadiepy-0.0.2.dev0/tests/test_drag_registry.py +197 -0
- sadiepy-0.0.2.dev0/tests/test_package.py +17 -0
- sadiepy-0.0.2.dev0/tests/test_presets.py +146 -0
- sadiepy-0.0.2.dev0/tests/test_solver.py +321 -0
- sadiepy-0.0.2.dev0/tests/test_units.py +115 -0
- sadiepy-0.0.2.dev0/tests/test_vegetation_drag_scaling.py +114 -0
- sadiepy-0.0.2.dev0/tests/test_vegetation_geometry.py +170 -0
- sadiepy-0.0.2.dev0/tests/test_waves.py +280 -0
- sadiepy-0.0.1.dev0/CHANGELOG.md +0 -16
- sadiepy-0.0.1.dev0/src/sadiepy/__init__.py +0 -11
- sadiepy-0.0.1.dev0/src/sadiepy/presets/__init__.py +0 -1
- sadiepy-0.0.1.dev0/tests/test_package.py +0 -12
- {sadiepy-0.0.1.dev0 → sadiepy-0.0.2.dev0}/LICENSE +0 -0
- {sadiepy-0.0.1.dev0 → sadiepy-0.0.2.dev0}/src/sadiepy/analysis/__init__.py +0 -0
- {sadiepy-0.0.1.dev0 → sadiepy-0.0.2.dev0}/src/sadiepy/core/__init__.py +0 -0
- {sadiepy-0.0.1.dev0 → sadiepy-0.0.2.dev0}/src/sadiepy/design/__init__.py +0 -0
- {sadiepy-0.0.1.dev0 → sadiepy-0.0.2.dev0}/src/sadiepy/py.typed +0 -0
- {sadiepy-0.0.1.dev0 → sadiepy-0.0.2.dev0}/src/sadiepy/scaling/__init__.py +0 -0
|
@@ -42,3 +42,16 @@ jobs:
|
|
|
42
42
|
run: python -m pip install -e ".[dev]"
|
|
43
43
|
- name: Pytest
|
|
44
44
|
run: pytest
|
|
45
|
+
|
|
46
|
+
docs:
|
|
47
|
+
name: Build documentation
|
|
48
|
+
runs-on: ubuntu-latest
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/checkout@v4
|
|
51
|
+
- uses: actions/setup-python@v5
|
|
52
|
+
with:
|
|
53
|
+
python-version: "3.12"
|
|
54
|
+
- name: Install
|
|
55
|
+
run: python -m pip install -e ".[docs]"
|
|
56
|
+
- name: Sphinx (warnings are errors; runs the example notebooks)
|
|
57
|
+
run: sphinx-build -W --keep-going -b html docs docs/_build/html
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
# Publishing a GitHub release (tag vX.Y.Z) builds the package and uploads it to PyPI,
|
|
4
|
+
# so GitHub Releases and PyPI always carry the same versions.
|
|
5
|
+
on:
|
|
6
|
+
release:
|
|
7
|
+
types: [published]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
name: Check, test and build
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.12"
|
|
21
|
+
- name: Check that the tag matches the package version
|
|
22
|
+
env:
|
|
23
|
+
TAG: ${{ github.event.release.tag_name }}
|
|
24
|
+
run: |
|
|
25
|
+
VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
|
|
26
|
+
echo "tag: $TAG, pyproject.toml version: $VERSION"
|
|
27
|
+
if [ "$TAG" != "v$VERSION" ]; then
|
|
28
|
+
echo "::error::Release tag $TAG does not match pyproject.toml version $VERSION (expected v$VERSION)"
|
|
29
|
+
exit 1
|
|
30
|
+
fi
|
|
31
|
+
- name: Install
|
|
32
|
+
run: python -m pip install -e ".[dev]" build twine
|
|
33
|
+
- name: Tests
|
|
34
|
+
run: pytest
|
|
35
|
+
- name: Build sdist and wheel
|
|
36
|
+
run: python -m build
|
|
37
|
+
- name: Check distributions
|
|
38
|
+
run: python -m twine check --strict dist/*
|
|
39
|
+
- uses: actions/upload-artifact@v4
|
|
40
|
+
with:
|
|
41
|
+
name: dist
|
|
42
|
+
path: dist/
|
|
43
|
+
|
|
44
|
+
publish:
|
|
45
|
+
name: Upload to PyPI
|
|
46
|
+
needs: build
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
environment:
|
|
49
|
+
name: pypi
|
|
50
|
+
url: https://pypi.org/project/sadiepy/
|
|
51
|
+
permissions:
|
|
52
|
+
id-token: write # PyPI trusted publishing; no API token is stored
|
|
53
|
+
steps:
|
|
54
|
+
- uses: actions/download-artifact@v4
|
|
55
|
+
with:
|
|
56
|
+
name: dist
|
|
57
|
+
path: dist/
|
|
58
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -264,3 +264,10 @@ Temporary Items
|
|
|
264
264
|
|
|
265
265
|
# Claude Code project files (local only)
|
|
266
266
|
.claude/
|
|
267
|
+
|
|
268
|
+
# Reference papers (copyrighted; see refs/README.md for citations and links)
|
|
269
|
+
refs/*.pdf
|
|
270
|
+
|
|
271
|
+
# Sphinx autosummary output
|
|
272
|
+
docs/api/generated/
|
|
273
|
+
docs/jupyter_execute/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Read the Docs configuration: https://docs.readthedocs.io/en/stable/config-file/v2.html
|
|
2
|
+
version: 2
|
|
3
|
+
|
|
4
|
+
build:
|
|
5
|
+
os: ubuntu-24.04
|
|
6
|
+
tools:
|
|
7
|
+
python: "3.12"
|
|
8
|
+
|
|
9
|
+
python:
|
|
10
|
+
install:
|
|
11
|
+
- method: pip
|
|
12
|
+
path: .
|
|
13
|
+
extra_requirements:
|
|
14
|
+
- docs
|
|
15
|
+
|
|
16
|
+
sphinx:
|
|
17
|
+
configuration: docs/conf.py
|
|
18
|
+
fail_on_warning: true
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
|
|
6
|
+
this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.0.2.dev0] - 2026-11-23
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Zhang et al. (2023) mangrove presets M1-M3 at model and prototype scale, with the
|
|
15
|
+
Table 2 test matrix and the Fig. 4 damping factors; generic `rigid_cylinders` preset.
|
|
16
|
+
- Registry of the ten published drag closures of Zhang et al. (2023), Table 3; closures
|
|
17
|
+
record source scale, vegetation and components, and may use named length scales
|
|
18
|
+
(`d`, `l_e`, `l_ew`, `r_v`).
|
|
19
|
+
- Vegetation volumes, SVF and characteristic lengths; layer-averaged and depth-averaged
|
|
20
|
+
geometries (Zhang Eqs. 19-20 and Eq. 4).
|
|
21
|
+
- `propagate(..., cd_evaluation="incident" | "local", scale=...)` and Re rescaling
|
|
22
|
+
between Froude scales; vegetation scaling to prototype.
|
|
23
|
+
- Theory section 5.
|
|
24
|
+
- Release workflow: publishing a GitHub release uploads the same version to PyPI.
|
|
25
|
+
- `02_tour` notebook: a plain-English tour of every current capability, with figures.
|
|
26
|
+
- `01_quickstart` notebook rewritten as a step-by-step tutorial covering every object, option, result field and error message.
|
|
27
|
+
- Documentation site (Sphinx, PyData theme, MyST-NB; Read the Docs config) with the
|
|
28
|
+
theory, an API reference and example notebooks in `docs/examples`
|
|
29
|
+
(`01_quickstart.ipynb`); `[examples]` and `[docs]` extras; CI docs build.
|
|
30
|
+
- `Water`: seawater density and viscosity from temperature and salinity (g/kg),
|
|
31
|
+
after Sharqawy et al. (2010), with validity warnings.
|
|
32
|
+
- `RegularWave` and `core.waves`: linear wave theory (dispersion solver, wavelength,
|
|
33
|
+
phase and group speed, orbital velocity, energy and energy flux, Re/KC/Ur) with
|
|
34
|
+
breaking and steepness validity warnings.
|
|
35
|
+
- `ValidityWarning`, `ExtrapolationWarning`; `GRAVITY` = 9.80665 m/s².
|
|
36
|
+
- `Layer`, `Vegetation`: layered vegetation with constant or height-dependent
|
|
37
|
+
frontal width.
|
|
38
|
+
- `drag.constant`, `drag.custom`: drag-coefficient closures (constant or a function of
|
|
39
|
+
Re, KC or Ur).
|
|
40
|
+
- `propagate`: wave damping across a vegetation patch (analytic hyperbolic decay for
|
|
41
|
+
constant C_D, ODE otherwise), with effective beta, layer fractions, energy
|
|
42
|
+
bookkeeping and extrapolation warnings.
|
|
43
|
+
- `scaling.froude`: Froude scale factors and model/prototype conversion.
|
|
44
|
+
- `docs/theory.md` §1-4: water properties, linear wave theory, vegetation damping,
|
|
45
|
+
Froude scaling.
|
|
46
|
+
|
|
47
|
+
## [0.0.1.dev0] - 2026-11-22
|
|
48
|
+
|
|
49
|
+
Name reservation on PyPI.
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
|
|
53
|
+
- Project scaffold: `pyproject.toml` (hatchling, `src/` layout), package skeleton
|
|
54
|
+
(`core`, `presets`, `scaling`, `analysis`, `design`), smoke tests.
|
|
55
|
+
- Tooling: pytest, ruff (lint and format), mypy (strict).
|
|
56
|
+
- GitHub Actions CI: lint/type-check job and test matrix for Python 3.10–3.12.
|
|
57
|
+
- `README.md`, `CITATION.cff`, `CHANGELOG.md`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: sadiepy
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.2.dev0
|
|
4
4
|
Summary: Physics-based prediction of wave damping by vegetation, with tradespace tools for designing and analysing flume experiments.
|
|
5
5
|
Project-URL: Repository, https://github.com/malbye/sadiepy
|
|
6
6
|
Project-URL: Issues, https://github.com/malbye/sadiepy/issues
|
|
@@ -24,12 +24,24 @@ Provides-Extra: dev
|
|
|
24
24
|
Requires-Dist: mypy>=1.11; extra == 'dev'
|
|
25
25
|
Requires-Dist: pytest>=8; extra == 'dev'
|
|
26
26
|
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
27
|
+
Provides-Extra: docs
|
|
28
|
+
Requires-Dist: ipykernel>=6; extra == 'docs'
|
|
29
|
+
Requires-Dist: matplotlib>=3.7; extra == 'docs'
|
|
30
|
+
Requires-Dist: myst-nb>=1.1; extra == 'docs'
|
|
31
|
+
Requires-Dist: pydata-sphinx-theme>=0.15; extra == 'docs'
|
|
32
|
+
Requires-Dist: sphinx-copybutton>=0.5; extra == 'docs'
|
|
33
|
+
Requires-Dist: sphinx>=7; extra == 'docs'
|
|
34
|
+
Provides-Extra: examples
|
|
35
|
+
Requires-Dist: ipykernel>=6; extra == 'examples'
|
|
36
|
+
Requires-Dist: matplotlib>=3.7; extra == 'examples'
|
|
27
37
|
Description-Content-Type: text/markdown
|
|
28
38
|
|
|
29
39
|
# SADIE: Simulation, Analysis, and Design In Ecohydraulics
|
|
30
40
|
|
|
31
|
-
<!-- Badges to add once each exists:
|
|
41
|
+
<!-- Badges to add once each exists: Python versions (after a final release), DOI (Zenodo). -->
|
|
42
|
+
[](https://pypi.org/project/sadiepy/)
|
|
32
43
|
[](https://github.com/malbye/sadiepy/actions/workflows/ci.yml)
|
|
44
|
+
[](https://sadiepy.readthedocs.io)
|
|
33
45
|
[](https://github.com/malbye/sadiepy/blob/main/LICENSE)
|
|
34
46
|
|
|
35
47
|
> **Status:** early development (pre-release).
|
|
@@ -44,6 +56,8 @@ framework. It supports flume experiment design before an experiment (tradespace
|
|
|
44
56
|
analysis of candidate designs) and data analysis after it (reflection separation,
|
|
45
57
|
damping-factor fitting, and drag-coefficient back-calculation).
|
|
46
58
|
|
|
59
|
+
Documentation: [https://sadiepy.readthedocs.io](https://sadiepy.readthedocs.io)
|
|
60
|
+
|
|
47
61
|
Repository: [https://github.com/malbye/sadiepy](https://github.com/malbye/sadiepy)
|
|
48
62
|
|
|
49
63
|
## Installation
|
|
@@ -64,6 +78,33 @@ pip install -e .
|
|
|
64
78
|
|
|
65
79
|
Note: the following optional dependencies are available with bracket notation:
|
|
66
80
|
* `pip install -e ".[dev]"`: for development (unit testing, linting, and type checking)
|
|
81
|
+
* `pip install -e ".[examples]"`: for running the example notebooks in `docs/examples`
|
|
82
|
+
* `pip install -e ".[docs]"`: for building the documentation site (includes `examples`)
|
|
83
|
+
|
|
84
|
+
## Getting Started
|
|
85
|
+
|
|
86
|
+
New to SADIE? Start with the two example notebooks in `docs/examples`, in order:
|
|
87
|
+
|
|
88
|
+
1. [**01 – Tutorial: how SADIE works**](https://github.com/malbye/sadiepy/blob/main/docs/examples/01_quickstart.ipynb):
|
|
89
|
+
a slow, step-by-step introduction to every object (water, waves, vegetation layers,
|
|
90
|
+
drag laws), how to run a calculation, how to read the result, and what the warnings
|
|
91
|
+
and error messages mean.
|
|
92
|
+
2. [**02 – A tour of SADIE**](https://github.com/malbye/sadiepy/blob/main/docs/examples/02_tour.ipynb):
|
|
93
|
+
a visual, plain-English overview of everything SADIE can currently do, with larger
|
|
94
|
+
examples and figures.
|
|
95
|
+
|
|
96
|
+
To run them yourself, install the `examples` extra (`pip install -e ".[examples]"`) and
|
|
97
|
+
open them in Jupyter.
|
|
98
|
+
|
|
99
|
+
A minimal example:
|
|
100
|
+
```python
|
|
101
|
+
import sadiepy as sd
|
|
102
|
+
|
|
103
|
+
wave = sd.RegularWave(H=0.08, T=1.4, depth=0.4) # height (m), period (s), depth (m)
|
|
104
|
+
veg = sd.presets.zhang2023("M3") # 1:10 mangrove model, Zhang et al. (2023)
|
|
105
|
+
res = sd.propagate(wave, veg, patch_length=2.0, drag=1.0)
|
|
106
|
+
print(res.beta, res.H) # damping factor (1/m), heights (m)
|
|
107
|
+
```
|
|
67
108
|
|
|
68
109
|
## Development Tools
|
|
69
110
|
|
|
@@ -81,6 +122,15 @@ Run a subset of tests by file, or by a keyword expression with `-k`:
|
|
|
81
122
|
pytest tests/test_package.py -k "version"
|
|
82
123
|
```
|
|
83
124
|
|
|
125
|
+
### Documentation
|
|
126
|
+
|
|
127
|
+
Build the documentation site (Sphinx; this also runs the example notebooks in
|
|
128
|
+
`docs/examples`) from the project root with:
|
|
129
|
+
```shell
|
|
130
|
+
sphinx-build -b html docs docs/_build/html
|
|
131
|
+
```
|
|
132
|
+
then open `docs/_build/html/index.html`.
|
|
133
|
+
|
|
84
134
|
### Code Style
|
|
85
135
|
|
|
86
136
|
This project uses ruff for linting and formatting, applied from the project root:
|
|
@@ -94,6 +144,14 @@ Type checking uses mypy in strict mode (configured in `pyproject.toml`):
|
|
|
94
144
|
mypy
|
|
95
145
|
```
|
|
96
146
|
|
|
147
|
+
### Releasing
|
|
148
|
+
|
|
149
|
+
Releases are made from GitHub; PyPI is updated automatically. Bump `version` in
|
|
150
|
+
`pyproject.toml` and add a `CHANGELOG.md` entry (merged through a pull request), then
|
|
151
|
+
publish a GitHub release with the tag `v<version>` (e.g. `v0.1.0`). The `Release`
|
|
152
|
+
workflow checks that the tag matches the version, runs the tests, builds the package
|
|
153
|
+
and uploads it to PyPI (trusted publishing).
|
|
154
|
+
|
|
97
155
|
## License
|
|
98
156
|
|
|
99
157
|
This project is licensed under the MIT License — see
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
# SADIE: Simulation, Analysis, and Design In Ecohydraulics
|
|
2
2
|
|
|
3
|
-
<!-- Badges to add once each exists:
|
|
3
|
+
<!-- Badges to add once each exists: Python versions (after a final release), DOI (Zenodo). -->
|
|
4
|
+
[](https://pypi.org/project/sadiepy/)
|
|
4
5
|
[](https://github.com/malbye/sadiepy/actions/workflows/ci.yml)
|
|
6
|
+
[](https://sadiepy.readthedocs.io)
|
|
5
7
|
[](https://github.com/malbye/sadiepy/blob/main/LICENSE)
|
|
6
8
|
|
|
7
9
|
> **Status:** early development (pre-release).
|
|
@@ -16,6 +18,8 @@ framework. It supports flume experiment design before an experiment (tradespace
|
|
|
16
18
|
analysis of candidate designs) and data analysis after it (reflection separation,
|
|
17
19
|
damping-factor fitting, and drag-coefficient back-calculation).
|
|
18
20
|
|
|
21
|
+
Documentation: [https://sadiepy.readthedocs.io](https://sadiepy.readthedocs.io)
|
|
22
|
+
|
|
19
23
|
Repository: [https://github.com/malbye/sadiepy](https://github.com/malbye/sadiepy)
|
|
20
24
|
|
|
21
25
|
## Installation
|
|
@@ -36,6 +40,33 @@ pip install -e .
|
|
|
36
40
|
|
|
37
41
|
Note: the following optional dependencies are available with bracket notation:
|
|
38
42
|
* `pip install -e ".[dev]"`: for development (unit testing, linting, and type checking)
|
|
43
|
+
* `pip install -e ".[examples]"`: for running the example notebooks in `docs/examples`
|
|
44
|
+
* `pip install -e ".[docs]"`: for building the documentation site (includes `examples`)
|
|
45
|
+
|
|
46
|
+
## Getting Started
|
|
47
|
+
|
|
48
|
+
New to SADIE? Start with the two example notebooks in `docs/examples`, in order:
|
|
49
|
+
|
|
50
|
+
1. [**01 – Tutorial: how SADIE works**](https://github.com/malbye/sadiepy/blob/main/docs/examples/01_quickstart.ipynb):
|
|
51
|
+
a slow, step-by-step introduction to every object (water, waves, vegetation layers,
|
|
52
|
+
drag laws), how to run a calculation, how to read the result, and what the warnings
|
|
53
|
+
and error messages mean.
|
|
54
|
+
2. [**02 – A tour of SADIE**](https://github.com/malbye/sadiepy/blob/main/docs/examples/02_tour.ipynb):
|
|
55
|
+
a visual, plain-English overview of everything SADIE can currently do, with larger
|
|
56
|
+
examples and figures.
|
|
57
|
+
|
|
58
|
+
To run them yourself, install the `examples` extra (`pip install -e ".[examples]"`) and
|
|
59
|
+
open them in Jupyter.
|
|
60
|
+
|
|
61
|
+
A minimal example:
|
|
62
|
+
```python
|
|
63
|
+
import sadiepy as sd
|
|
64
|
+
|
|
65
|
+
wave = sd.RegularWave(H=0.08, T=1.4, depth=0.4) # height (m), period (s), depth (m)
|
|
66
|
+
veg = sd.presets.zhang2023("M3") # 1:10 mangrove model, Zhang et al. (2023)
|
|
67
|
+
res = sd.propagate(wave, veg, patch_length=2.0, drag=1.0)
|
|
68
|
+
print(res.beta, res.H) # damping factor (1/m), heights (m)
|
|
69
|
+
```
|
|
39
70
|
|
|
40
71
|
## Development Tools
|
|
41
72
|
|
|
@@ -53,6 +84,15 @@ Run a subset of tests by file, or by a keyword expression with `-k`:
|
|
|
53
84
|
pytest tests/test_package.py -k "version"
|
|
54
85
|
```
|
|
55
86
|
|
|
87
|
+
### Documentation
|
|
88
|
+
|
|
89
|
+
Build the documentation site (Sphinx; this also runs the example notebooks in
|
|
90
|
+
`docs/examples`) from the project root with:
|
|
91
|
+
```shell
|
|
92
|
+
sphinx-build -b html docs docs/_build/html
|
|
93
|
+
```
|
|
94
|
+
then open `docs/_build/html/index.html`.
|
|
95
|
+
|
|
56
96
|
### Code Style
|
|
57
97
|
|
|
58
98
|
This project uses ruff for linting and formatting, applied from the project root:
|
|
@@ -66,6 +106,14 @@ Type checking uses mypy in strict mode (configured in `pyproject.toml`):
|
|
|
66
106
|
mypy
|
|
67
107
|
```
|
|
68
108
|
|
|
109
|
+
### Releasing
|
|
110
|
+
|
|
111
|
+
Releases are made from GitHub; PyPI is updated automatically. Bump `version` in
|
|
112
|
+
`pyproject.toml` and add a `CHANGELOG.md` entry (merged through a pull request), then
|
|
113
|
+
publish a GitHub release with the tag `v<version>` (e.g. `v0.1.0`). The `Release`
|
|
114
|
+
workflow checks that the tag matches the version, runs the tests, builds the package
|
|
115
|
+
and uploads it to PyPI (trusted publishing).
|
|
116
|
+
|
|
69
117
|
## License
|
|
70
118
|
|
|
71
119
|
This project is licensed under the MIT License — see
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# API reference
|
|
2
|
+
|
|
3
|
+
```{eval-rst}
|
|
4
|
+
.. currentmodule:: sadiepy
|
|
5
|
+
|
|
6
|
+
Top level
|
|
7
|
+
---------
|
|
8
|
+
|
|
9
|
+
.. autosummary::
|
|
10
|
+
:toctree: generated
|
|
11
|
+
:nosignatures:
|
|
12
|
+
|
|
13
|
+
Water
|
|
14
|
+
RegularWave
|
|
15
|
+
Layer
|
|
16
|
+
Vegetation
|
|
17
|
+
propagate
|
|
18
|
+
PropagationResult
|
|
19
|
+
ValidityWarning
|
|
20
|
+
ExtrapolationWarning
|
|
21
|
+
|
|
22
|
+
Modules
|
|
23
|
+
-------
|
|
24
|
+
|
|
25
|
+
.. autosummary::
|
|
26
|
+
:toctree: generated
|
|
27
|
+
|
|
28
|
+
units
|
|
29
|
+
core.waves
|
|
30
|
+
core.vegetation
|
|
31
|
+
core.drag
|
|
32
|
+
core.solver
|
|
33
|
+
scaling.froude
|
|
34
|
+
presets.zhang2023
|
|
35
|
+
presets.generic
|
|
36
|
+
```
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"""Sphinx configuration for the SADIE documentation site."""
|
|
2
|
+
|
|
3
|
+
from importlib.metadata import version as _version
|
|
4
|
+
|
|
5
|
+
project = "SADIE"
|
|
6
|
+
author = "Mallory Byers"
|
|
7
|
+
copyright = "2026, Mallory Byers" # noqa: A001
|
|
8
|
+
release = _version("sadiepy")
|
|
9
|
+
version = release
|
|
10
|
+
|
|
11
|
+
extensions = [
|
|
12
|
+
"myst_nb", # Markdown (MyST) pages and Jupyter notebooks
|
|
13
|
+
"sphinx.ext.autodoc",
|
|
14
|
+
"sphinx.ext.autosummary",
|
|
15
|
+
"sphinx.ext.napoleon", # NumPy-style docstrings
|
|
16
|
+
"sphinx.ext.intersphinx",
|
|
17
|
+
"sphinx.ext.mathjax",
|
|
18
|
+
"sphinx.ext.viewcode",
|
|
19
|
+
"sphinx_copybutton",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "**.ipynb_checkpoints"]
|
|
23
|
+
|
|
24
|
+
# --- MyST / notebooks -------------------------------------------------------------
|
|
25
|
+
myst_enable_extensions = ["dollarmath", "amsmath", "colon_fence"]
|
|
26
|
+
myst_heading_anchors = 3
|
|
27
|
+
nb_execution_mode = "cache" # run notebooks at build time; cache unchanged ones
|
|
28
|
+
nb_execution_raise_on_error = True # a failing notebook fails the build
|
|
29
|
+
nb_execution_timeout = 300
|
|
30
|
+
nb_render_markdown_format = "myst" # render Markdown cell outputs (e.g. tables) with MyST
|
|
31
|
+
|
|
32
|
+
# --- API reference ----------------------------------------------------------------
|
|
33
|
+
autosummary_generate = True
|
|
34
|
+
autodoc_typehints = "description"
|
|
35
|
+
autodoc_member_order = "bysource"
|
|
36
|
+
napoleon_google_docstring = False
|
|
37
|
+
napoleon_numpy_docstring = True
|
|
38
|
+
napoleon_use_rtype = False
|
|
39
|
+
|
|
40
|
+
intersphinx_mapping = {
|
|
41
|
+
"python": ("https://docs.python.org/3", None),
|
|
42
|
+
"numpy": ("https://numpy.org/doc/stable/", None),
|
|
43
|
+
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
# --- HTML -------------------------------------------------------------------------
|
|
47
|
+
html_theme = "pydata_sphinx_theme"
|
|
48
|
+
html_title = "SADIE"
|
|
49
|
+
html_theme_options = {
|
|
50
|
+
"github_url": "https://github.com/malbye/sadiepy",
|
|
51
|
+
"navbar_align": "left",
|
|
52
|
+
"show_toc_level": 2,
|
|
53
|
+
"use_edit_page_button": False,
|
|
54
|
+
}
|
|
55
|
+
html_context = {
|
|
56
|
+
"github_user": "malbye",
|
|
57
|
+
"github_repo": "sadiepy",
|
|
58
|
+
"github_version": "main",
|
|
59
|
+
"doc_path": "docs",
|
|
60
|
+
}
|