Skip to content

Commit

Permalink
Move docs from readme to markdown files and docstring (#459)
Browse files Browse the repository at this point in the history
Co-authored-by: Sylwester Arabas <sylwester.arabas@agh.edu.pl>
  • Loading branch information
pawelmagnu and slayoo authored Sep 30, 2024
1 parent 52b1d08 commit 2e43989
Show file tree
Hide file tree
Showing 9 changed files with 708 additions and 547 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests+pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
pip3 install pdoc
pip install -e . -e ./examples
export PDOC_ALLOW_EXEC=1
python -We -m pdoc -o html PyMPDATA examples/PyMPDATA_examples -t pdoc_templates
python -We -m pdoc -o html PyMPDATA examples/PyMPDATA_examples -t docs/templates
- if: ${{ github.ref == 'refs/heads/main' && matrix.platform == 'ubuntu-latest' }}
uses: JamesIves/github-pages-deploy-action@4.1.1
with:
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ default_stages: [commit]

repos:
- repo: https://github.com/psf/black
rev: 24.1.1
rev: 24.8.0
hooks:
- id: black

Expand All @@ -15,7 +15,7 @@ repos:
args: ["--profile", "black"]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
8 changes: 1 addition & 7 deletions PyMPDATA/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
"""
Numba-accelerated Pythonic implementation of Multidimensional Positive Definite
Advection Transport Algorithm (MPDATA) with examples in Python, Julia and Matlab
PyMPDATA uses staggered grid with the following node placement for
`PyMPDATA.scalar_field.ScalarField` and
`PyMPDATA.vector_field.VectorField` elements:
![](https://github.com/atmos-cloud-sim-uj/PyMPDATA/releases/download/tip/readme_grid.png)
.. include:: ../docs/markdown/pympdata_landing.md
"""

# pylint: disable=invalid-name
Expand Down
540 changes: 33 additions & 507 deletions README.md

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions docs/markdown/pympdata_examples_landing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Introduction
PyMPDATA examples are bundled with PyMPDATA and located in the examples subfolder.
They constitute a separate PyMPDATA_examples Python package which is also available at PyPI.
The examples have additional dependencies listed in PyMPDATA_examples package setup.py file.
Running the examples requires the PyMPDATA_examples package to be installed.

Below is an example of how to use the PyMPDATA_examples package to run a simple advection-diffusion in 2D
`PyMPDATA_examples.advection_diffusion_2d`
![adv_diff](https://github.com/open-atmos/PyMPDATA/releases/download/tip/advection_diffusion.gif)

# Installation
Since the examples package includes Jupyter notebooks (and their execution requires write access), the suggested install and launch steps are:

```
git clone https://github.com/open-atmos/PyMPDATA-examples.git
cd PyMPDATA-examples
pip install -e .
jupyter-notebook
```

Alternatively, one can also install the examples package from pypi.org by using
```
pip install PyMPDATA-examples.
```
Loading

0 comments on commit 2e43989

Please sign in to comment.