diff --git a/.github/workflows/_build_doc.yaml b/.github/workflows/_build_doc.yaml index c875a9d..ad54161 100644 --- a/.github/workflows/_build_doc.yaml +++ b/.github/workflows/_build_doc.yaml @@ -33,9 +33,10 @@ jobs: - name: Install dependencies run: | - python -m pip install --upgrade pip - python -m pip install . - python -m pip install -r doc/requirements.txt + python -m pip install --user --upgrade pip + python -m pip install --user . + python -m pip install --user -r doc/requirements.txt + DEBIAN_FRONTEND=noninteractive sudo apt-get install -y pandoc - name: Build the documentation run: cd doc && make html diff --git a/Makefile b/Makefile index d288db1..23dc535 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ build: .PHONY: dev dev: @git lfs install - $(PYTHON) -m pip install -e ".[dev,test]" + $(PYTHON) -m pip install -e ".[dev,test,jupyter,examples]" ## install Install the package ## diff --git a/README.md b/README.md index c4b74a4..10c7aff 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![GitHub](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com/btschwertfeger/python-cmethods) [![Generic badge](https://img.shields.io/badge/python-3.8_|_3.9_|_3.10_|_3.11|_3.12-blue.svg)](https://shields.io/) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-orange.svg)](https://www.gnu.org/licenses/gpl-3.0) -[![Downloads](https://pepy.tech/badge/python-cmethods)](https://pepy.tech/project/python-cmethods) +[![PyPI Downloads](https://pepy.tech/badge/python-cmethods)](https://pepy.tech/project/python-cmethods) [![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) [![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/ python3 -m pip install python-cmethods ``` +The package is also available via conda-forge. See +[conda-forge/python_cmethods-feedstock](https://github.com/conda-forge/python_cmethods-feedstock/tree/main) for more +information. + ## 4. CLI Usage diff --git a/doc/Makefile b/doc/Makefile index d4bb2cb..1c0cc00 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -18,3 +18,4 @@ help: # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + rm $(SOURCEDIR)/examples.ipynb diff --git a/doc/conf.py b/doc/conf.py index 2ed5bda..58bbc0f 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -27,6 +27,14 @@ with open("links.rst", encoding="utf-8") as f: rst_epilog += f.read() + +def setup(app) -> None: # noqa: ARG001 + from os.path import join + from shutil import copyfile + + copyfile(join("..", "examples", "examples.ipynb"), "examples.ipynb") + + # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -38,10 +46,12 @@ "sphinx.ext.napoleon", "sphinx.ext.autosectionlabel", "sphinx.ext.mathjax", + "nbsphinx", + "IPython.sphinxext.ipython_console_highlighting", ] templates_path = ["_templates"] -exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "links.rst"] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "links.rst", "**.ipynb_checkpoints"] # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output diff --git a/doc/getting_started.rst b/doc/getting_started.rst index 0fb97d8..51d1faf 100644 --- a/doc/getting_started.rst +++ b/doc/getting_started.rst @@ -18,6 +18,8 @@ The `python-cmethods`_ module can be installed using the package manager pip: python3 -m pip install python-cmethods +The package is also available via conda-forge. See +`python_cmethods-feedstock`_ for more information. Command-Line Interface Usage ---------------------------- diff --git a/doc/index.rst b/doc/index.rst index 4203605..e6b6763 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -12,6 +12,7 @@ Welcome to python-cmethods's documentation! introduction.rst getting_started.rst + examples.ipynb cli.rst cmethods.rst methods.rst diff --git a/doc/links.rst b/doc/links.rst index d90462d..5b6f19e 100644 --- a/doc/links.rst +++ b/doc/links.rst @@ -7,6 +7,8 @@ .. _python-cmethods: https://github.com/btschwertfeger/python-cmethods +.. _python_cmethods-feedstock: https://github.com/conda-forge/python_cmethods-feedstock/tree/main + .. _python-cmethods/issues: https://github.com/btschwertfeger/python-cmethods/issues .. _python-cmethods/discussions: https://github.com/btschwertfeger/python-cmethods/discussions diff --git a/doc/requirements.txt b/doc/requirements.txt index 27d2f77..99d9ec9 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,4 +1,6 @@ cloup +ipython +nbsphinx netCDF4>=1.6.1 numpy setuptools_scm diff --git a/examples/examples.ipynb b/examples/examples.ipynb index 34dd71a..8f8d2d6 100644 --- a/examples/examples.ipynb +++ b/examples/examples.ipynb @@ -4,7 +4,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Example notebook to apply bias adjustment techniques " + "# Hands-On Tutorial" ] }, { @@ -28,7 +28,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Define some functions " + "## Define some functions " ] }, { @@ -59,7 +59,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Create dummy data" + "## Create dummy data" ] }, { @@ -110,7 +110,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Plot created toy data" + "## Plot created toy data" ] }, { @@ -151,7 +151,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Import module to adjust the data" + "## Import module to adjust the data" ] }, { @@ -1211,9 +1211,9 @@ ], "metadata": { "kernelspec": { - "display_name": "🐍 venv repositories/awi-workspace/python-cmethods/venv | Python 3.11.2", + "display_name": "python-cmethods", "language": "python", - "name": "myvenv" + "name": "python-cmethods" }, "language_info": { "codemirror_mode": { @@ -1225,7 +1225,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.2" + "version": "3.10.12" }, "vscode": { "interpreter": { diff --git a/pyproject.toml b/pyproject.toml index 9a100d7..a7a1f45 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,6 +87,7 @@ dev = [ # documentation "sphinx", "sphinx-rtd-theme", + "nbsphinx", # linting "pylint", "flake8",