-
Notifications
You must be signed in to change notification settings - Fork 3
Standardize NumPy-style docstrings and add Sphinx + GitHub Pages docs publishing #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: docs | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
|
|
||
| concurrency: | ||
| group: pages | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install -r docs/requirements.txt | ||
| python -m pip install -e . | ||
| - name: Build HTML docs | ||
| run: sphinx-build -b html docs docs/_build/html | ||
| - name: Setup Pages | ||
| uses: actions/configure-pages@v5 | ||
| - name: Upload artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: docs/_build/html | ||
|
|
||
| deploy: | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| runs-on: ubuntu-latest | ||
| needs: build | ||
| steps: | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| API reference | ||
| ============= | ||
|
|
||
| .. automodule:: rxmc | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
|
|
||
| .. automodule:: rxmc.params | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
|
|
||
| .. automodule:: rxmc.observation | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
|
|
||
| .. automodule:: rxmc.constraint | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
|
|
||
| .. automodule:: rxmc.evidence | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
|
|
||
| .. automodule:: rxmc.likelihood_model | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
|
|
||
| .. automodule:: rxmc.physical_model | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
|
|
||
| .. automodule:: rxmc.param_sampling | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
|
|
||
| .. automodule:: rxmc.walker | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| """Sphinx configuration for rxmc documentation.""" | ||
|
|
||
| from pathlib import Path | ||
| import sys | ||
|
|
||
| ROOT = Path(__file__).resolve().parents[1] | ||
| sys.path.insert(0, str(ROOT / "src")) | ||
|
|
||
| project = "rxmc" | ||
| copyright = "2026, rxmc contributors" | ||
| author = "rxmc contributors" | ||
|
|
||
| extensions = [ | ||
| "sphinx.ext.autodoc", | ||
| "sphinx.ext.autosummary", | ||
| "sphinx.ext.napoleon", | ||
| ] | ||
|
|
||
| autosummary_generate = True | ||
| napoleon_numpy_docstring = True | ||
| napoleon_google_docstring = False | ||
|
|
||
| templates_path = ["_templates"] | ||
| exclude_patterns = ["_build"] | ||
|
|
||
| html_theme = "alabaster" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| rxmc documentation | ||
| ================== | ||
|
|
||
| `rxmc` provides tools for Bayesian calibration of reaction models. | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 2 | ||
| :caption: Contents | ||
|
|
||
| api |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| sphinx>=8 | ||
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| """Adaptive Metropolis sampling algorithms.""" | ||
|
|
||
| import numpy as np | ||
| from typing import Callable, Tuple | ||
|
|
||
|
|
@@ -14,8 +16,8 @@ def adaptive_metropolis( | |
| ) -> Tuple[np.ndarray, np.ndarray, int]: | ||
| """ | ||
| Adaptive Metropolis algorithm with a sliding window covariance adaptation. | ||
| Parameters: | ||
| --------- | ||
| Parameters | ||
| ---------- | ||
| x0 : np.ndarray | ||
| Initial point in the parameter space. | ||
|
Comment on lines
18
to
22
|
||
| n_steps : int | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.