Skip to content

Commit 85d7cb8

Browse files
Extend the documentation (#96)
1 parent 80ea299 commit 85d7cb8

File tree

11 files changed

+38
-14
lines changed

11 files changed

+38
-14
lines changed

.github/workflows/_build_doc.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ jobs:
3333

3434
- name: Install dependencies
3535
run: |
36-
python -m pip install --upgrade pip
37-
python -m pip install .
38-
python -m pip install -r doc/requirements.txt
36+
python -m pip install --user --upgrade pip
37+
python -m pip install --user .
38+
python -m pip install --user -r doc/requirements.txt
39+
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y pandoc
3940
4041
- name: Build the documentation
4142
run: cd doc && make html

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ build:
2525
.PHONY: dev
2626
dev:
2727
@git lfs install
28-
$(PYTHON) -m pip install -e ".[dev,test]"
28+
$(PYTHON) -m pip install -e ".[dev,test,jupyter,examples]"
2929

3030
## install Install the package
3131
##

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![GitHub](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com/btschwertfeger/python-cmethods)
66
[![Generic badge](https://img.shields.io/badge/python-3.8_|_3.9_|_3.10_|_3.11|_3.12-blue.svg)](https://shields.io/)
77
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-orange.svg)](https://www.gnu.org/licenses/gpl-3.0)
8-
[![Downloads](https://pepy.tech/badge/python-cmethods)](https://pepy.tech/project/python-cmethods)
8+
[![PyPI Downloads](https://pepy.tech/badge/python-cmethods)](https://pepy.tech/project/python-cmethods)
99

1010
[![CI/CD](https://github.com/btschwertfeger/python-cmethods/actions/workflows/cicd.yaml/badge.svg?branch=master)](https://github.com/btschwertfeger/python-cmethods/actions/workflows/cicd.yaml)
1111
[![codecov](https://codecov.io/github/btschwertfeger/python-cmethods/branch/master/graph/badge.svg?token=OSO4PAABPD)](https://codecov.io/github/btschwertfeger/python-cmethods)
@@ -144,6 +144,10 @@ https://python-cmethods.readthedocs.io/en/stable/
144144
python3 -m pip install python-cmethods
145145
```
146146

147+
The package is also available via conda-forge. See
148+
[conda-forge/python_cmethods-feedstock](https://github.com/conda-forge/python_cmethods-feedstock/tree/main) for more
149+
information.
150+
147151
<a name="examples"></a>
148152

149153
## 4. CLI Usage

doc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ help:
1818
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1919
%: Makefile
2020
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21+
rm $(SOURCEDIR)/examples.ipynb

doc/conf.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@
2727
with open("links.rst", encoding="utf-8") as f:
2828
rst_epilog += f.read()
2929

30+
31+
def setup(app) -> None: # noqa: ARG001
32+
from os.path import join
33+
from shutil import copyfile
34+
35+
copyfile(join("..", "examples", "examples.ipynb"), "examples.ipynb")
36+
37+
3038
# -- General configuration ---------------------------------------------------
3139
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
3240

@@ -38,10 +46,12 @@
3846
"sphinx.ext.napoleon",
3947
"sphinx.ext.autosectionlabel",
4048
"sphinx.ext.mathjax",
49+
"nbsphinx",
50+
"IPython.sphinxext.ipython_console_highlighting",
4151
]
4252

4353
templates_path = ["_templates"]
44-
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "links.rst"]
54+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "links.rst", "**.ipynb_checkpoints"]
4555

4656
# -- Options for HTML output -------------------------------------------------
4757
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

doc/getting_started.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ The `python-cmethods`_ module can be installed using the package manager pip:
1818
1919
python3 -m pip install python-cmethods
2020
21+
The package is also available via conda-forge. See
22+
`python_cmethods-feedstock`_ for more information.
2123

2224
Command-Line Interface Usage
2325
----------------------------

doc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Welcome to python-cmethods's documentation!
1212

1313
introduction.rst
1414
getting_started.rst
15+
examples.ipynb
1516
cli.rst
1617
cmethods.rst
1718
methods.rst

doc/links.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
88
.. _python-cmethods: https://github.com/btschwertfeger/python-cmethods
99

10+
.. _python_cmethods-feedstock: https://github.com/conda-forge/python_cmethods-feedstock/tree/main
11+
1012
.. _python-cmethods/issues: https://github.com/btschwertfeger/python-cmethods/issues
1113

1214
.. _python-cmethods/discussions: https://github.com/btschwertfeger/python-cmethods/discussions

doc/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
cloup
2+
ipython
3+
nbsphinx
24
netCDF4>=1.6.1
35
numpy
46
setuptools_scm

examples/examples.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Example notebook to apply bias adjustment techniques "
7+
"# Hands-On Tutorial"
88
]
99
},
1010
{
@@ -28,7 +28,7 @@
2828
"cell_type": "markdown",
2929
"metadata": {},
3030
"source": [
31-
"# Define some functions "
31+
"## Define some functions "
3232
]
3333
},
3434
{
@@ -59,7 +59,7 @@
5959
"cell_type": "markdown",
6060
"metadata": {},
6161
"source": [
62-
"# Create dummy data"
62+
"## Create dummy data"
6363
]
6464
},
6565
{
@@ -110,7 +110,7 @@
110110
"cell_type": "markdown",
111111
"metadata": {},
112112
"source": [
113-
"# Plot created toy data"
113+
"## Plot created toy data"
114114
]
115115
},
116116
{
@@ -151,7 +151,7 @@
151151
"cell_type": "markdown",
152152
"metadata": {},
153153
"source": [
154-
"# Import module to adjust the data"
154+
"## Import module to adjust the data"
155155
]
156156
},
157157
{
@@ -1211,9 +1211,9 @@
12111211
],
12121212
"metadata": {
12131213
"kernelspec": {
1214-
"display_name": "🐍 venv repositories/awi-workspace/python-cmethods/venv | Python 3.11.2",
1214+
"display_name": "python-cmethods",
12151215
"language": "python",
1216-
"name": "myvenv"
1216+
"name": "python-cmethods"
12171217
},
12181218
"language_info": {
12191219
"codemirror_mode": {
@@ -1225,7 +1225,7 @@
12251225
"name": "python",
12261226
"nbconvert_exporter": "python",
12271227
"pygments_lexer": "ipython3",
1228-
"version": "3.11.2"
1228+
"version": "3.10.12"
12291229
},
12301230
"vscode": {
12311231
"interpreter": {

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ dev = [
8787
# documentation
8888
"sphinx",
8989
"sphinx-rtd-theme",
90+
"nbsphinx",
9091
# linting
9192
"pylint",
9293
"flake8",

0 commit comments

Comments
 (0)