diff --git a/.github/workflows/tests+pypi.yml b/.github/workflows/tests+pypi.yml index 300d6821..e8bf7ace 100644 --- a/.github/workflows/tests+pypi.yml +++ b/.github/workflows/tests+pypi.yml @@ -95,10 +95,18 @@ jobs: - env: JUPYTER_PLATFORM_DIRS: 1 run: | - pip3 install pdoc + pip3 install pdoc nbformat pip install -e . -e ./examples - export PDOC_ALLOW_EXEC=1 - python -We -m pdoc -o html PyMPDATA examples/PyMPDATA_examples -t docs/templates + + python - <basic advection equation: +$$ \partial_t (\psi) + \nabla \cdot (u \psi) = 0 $$ + +The examples are grouped by the dimensionality of the computational grid. + +## in 1D +| tags | link | +|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------| +| advection-diffusion equation
$$ \partial_t (\psi) + \nabla \cdot (u \psi) + \mu \Delta (\psi) = 0 $$ | `PyMPDATA_examples.advection_diffusion_1d`* | +| Black-Scholes equation, option pricing
$$ \frac{\partial f}{\partial t} + rS \frac{\partial f}{\partial S} + \frac{\sigma^2}{2} S^2 \frac{\partial^2 f}{\partial S^2} - rf = 0$$ | `PyMPDATA_examples.Arabas_and_Farhat_2020`* | +| advection equation, homogeneous, several algorithm variants comparison: infinite-gauge, flux-corrected,.. | `PyMPDATA_examples.Smolarkiewicz_2006_Figs_3_4_10_11_12` | +| Size-spectral advection, particle population condensational growth, coordinate transformation
$$ \partial_t (G \psi) + \nabla \cdot (Gu \psi) = 0 $$ | `PyMPDATA_examples.Olesik_et_al_2022`* | +| advection equation, [double-pass donor-cell option](https://osti.gov/servlets/purl/7049237) | `PyMPDATA_examples.DPDC` | + +## in 2D +| tags | link | +|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| advection-diffusion equation
$$ \partial_t (\psi) + \nabla \cdot (u \psi) + \mu \Delta (\psi) = 0 $$ | `PyMPDATA_examples.advection_diffusion_2d`*
adv-diff | +| Spectral-spatial advection, particle population condensational growth in a vertical column of air, time dependent flow | `PyMPDATA_examples.Shipway_and_Hill_2012` | +| shallow-water equations
$$\begin{eqnarray} \partial_t h + \partial_x (uh) + \partial_y (vh) &=& 0~ \\\ \partial_t (uh) + \partial_x ( uuh) + \partial_y (vuh) &=& - h \partial_x h~ \\\ \partial_t (vh) + \partial_x ( uvh) + \partial_y (vvh) &=& - h \partial_y h~ \end{eqnarray}$$ | `PyMPDATA_examples.Jarecka_et_al_2015`* | +| advection equation, solid body rotation | `PyMPDATA_examples.Molenkamp_test_as_in_Jaruga_et_al_2015_Fig_12`* | +| advection equation, coordinate transformation, spherical coordinates, see also examples in [PYMPDATA-MPI](https://pypi.org/project/PyMPDATA-MPI/) $$ \partial_t (G \psi) + \nabla \cdot (Gu \psi) = 0 $$ | `PyMPDATA_examples.Williamson_and_Rasch_1989_as_in_Jaruga_et_al_2015_Fig_14`
mpi-gif | + +## in 3D +| tags | link | +|:------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------| +| homogeneous advection equation | `PyMPDATA_examples.Smolarkiewicz_1984` | +| homogeneous advection equation, performance comparison against libmpdata++, scalability analysis in respect to threads | `PyMPDATA_examples.Bartman_et_al_2022` | + +\* - with comparison against analytic solution # Installation Since the examples package includes Jupyter notebooks (and their execution requires write access), the suggested install and launch steps are: diff --git a/examples/PyMPDATA_examples/Arabas_and_Farhat_2020/__init__.py b/examples/PyMPDATA_examples/Arabas_and_Farhat_2020/__init__.py index 42fd658b..34b60703 100644 --- a/examples/PyMPDATA_examples/Arabas_and_Farhat_2020/__init__.py +++ b/examples/PyMPDATA_examples/Arabas_and_Farhat_2020/__init__.py @@ -4,6 +4,18 @@ study on pricing of European and American options using MPDATA. Each notebook in this directory corresponds to a figure or a table in the paper. + +fig_1.ipynb: +.. include:: ./fig_1.ipynb.badges.md + +fig_2.ipynb: +.. include:: ./fig_2.ipynb.badges.md + +fig_3.ipynb: +.. include:: ./fig_3.ipynb.badges.md + +tab_1.ipynb: +.. include:: ./tab_1.ipynb.badges.md """ from .simulation import Simulation diff --git a/examples/PyMPDATA_examples/Bartman_et_al_2022/__init__.py b/examples/PyMPDATA_examples/Bartman_et_al_2022/__init__.py index fd48dbbf..5302cc8d 100644 --- a/examples/PyMPDATA_examples/Bartman_et_al_2022/__init__.py +++ b/examples/PyMPDATA_examples/Bartman_et_al_2022/__init__.py @@ -1,4 +1,7 @@ """ This example is based on the paper: [Bartman et al. 2022](https://doi.org/10.21105/joss.03896). + +fig_X.ipynb: +.. include:: ./fig_X.ipynb.badges.md """ diff --git a/examples/PyMPDATA_examples/DPDC/__init__.py b/examples/PyMPDATA_examples/DPDC/__init__.py index d559df63..bc91f929 100644 --- a/examples/PyMPDATA_examples/DPDC/__init__.py +++ b/examples/PyMPDATA_examples/DPDC/__init__.py @@ -1,3 +1,6 @@ """ This example demonstrates the use of the Double-Pass Donor-Cell option in `PyMPDATA.options`. + +demo.ipynb: +.. include:: ./demo.ipynb.badges.md """ diff --git a/examples/PyMPDATA_examples/Jarecka_et_al_2015/__init__.py b/examples/PyMPDATA_examples/Jarecka_et_al_2015/__init__.py index 2e9b2113..84e8fb95 100644 --- a/examples/PyMPDATA_examples/Jarecka_et_al_2015/__init__.py +++ b/examples/PyMPDATA_examples/Jarecka_et_al_2015/__init__.py @@ -2,6 +2,9 @@ This module showcases the PyMPDATA implementation of an MPDATA-based shallow-water equations solver discussed and bencharked against analytical solutions in [Jarecka_et_al_2015](https://doi.org/10.1016/j.jcp.2015.02.003). + +fig_6.ipynb: +.. include:: ./fig_6.ipynb.badges.md """ from .plot_output import plot_output diff --git a/examples/PyMPDATA_examples/Molenkamp_test_as_in_Jaruga_et_al_2015_Fig_12/__init__.py b/examples/PyMPDATA_examples/Molenkamp_test_as_in_Jaruga_et_al_2015_Fig_12/__init__.py index ddd62819..2f94d7ad 100644 --- a/examples/PyMPDATA_examples/Molenkamp_test_as_in_Jaruga_et_al_2015_Fig_12/__init__.py +++ b/examples/PyMPDATA_examples/Molenkamp_test_as_in_Jaruga_et_al_2015_Fig_12/__init__.py @@ -2,4 +2,7 @@ This is an example based on the solid-body rotation test from [Molenkap 1968](http://doi.org/10.1175/1520-0450(1968)007%3C0160:AOFDMA%3E2.0.CO;2) (as in Fig. 12 in [Jaruga et al. 2015](https://doi.org/10.5194/gmd-8-1005-2015)). + +demo.ipynb: +.. include:: ./demo.ipynb.badges.md """ diff --git a/examples/PyMPDATA_examples/Olesik_et_al_2022/__init__.py b/examples/PyMPDATA_examples/Olesik_et_al_2022/__init__.py index 3029cc93..6b474dcd 100644 --- a/examples/PyMPDATA_examples/Olesik_et_al_2022/__init__.py +++ b/examples/PyMPDATA_examples/Olesik_et_al_2022/__init__.py @@ -2,4 +2,19 @@ This is a PyMPDATA implementation of 1D particle population condensational growth problem with coordinate transformations, as presented in [Olesik et al. 2022](https://doi.org/10.5194/gmd-15-3879-2022). + +demo_analytical_solution.ipynb: +.. include:: ./demo_analytical_solution.ipynb.badges.md + +demo_make_convergences.ipynb: +.. include:: ./demo_make_convergences.ipynb.badges.md + +demo_make_dispersion_ratio.ipynb: +.. include:: ./demo_make_dispersion_ratio.ipynb.badges.md + +demo_make_plots.ipynb: +.. include:: ./demo_make_plots.ipynb.badges.md + +demo_wall_times.ipynb: +.. include:: ./demo_wall_times.ipynb.badges.md """ diff --git a/examples/PyMPDATA_examples/Shipway_and_Hill_2012/__init__.py b/examples/PyMPDATA_examples/Shipway_and_Hill_2012/__init__.py index 5f97ed81..04367c3a 100644 --- a/examples/PyMPDATA_examples/Shipway_and_Hill_2012/__init__.py +++ b/examples/PyMPDATA_examples/Shipway_and_Hill_2012/__init__.py @@ -2,6 +2,9 @@ This is an example of 2D droplet size-spectral/spatial problem of condensational growth in a column of air, as described in [Shipway and Hill 2012](https://doi.org/10.1002/qj.1913). + +fig_1.ipynb +.. include:: ./fig_1.ipynb.badges.md """ from .arakawa_c import arakawa_c diff --git a/examples/PyMPDATA_examples/Smolarkiewicz_1984/__init__.py b/examples/PyMPDATA_examples/Smolarkiewicz_1984/__init__.py index ab115d37..267b9793 100644 --- a/examples/PyMPDATA_examples/Smolarkiewicz_1984/__init__.py +++ b/examples/PyMPDATA_examples/Smolarkiewicz_1984/__init__.py @@ -1,6 +1,9 @@ """ This is an example of 3D advection, a spherical signal revolving in a box, based on [Smolarkiewicz, 1984](https://doi.org/10.1016/0021-9991(84)90121-9). + +figs_13-14.ipynb: +.. include:: ./figs_13-14.ipynb.badges.md """ from .settings import Settings diff --git a/examples/PyMPDATA_examples/Smolarkiewicz_2006_Figs_3_4_10_11_12/__init__.py b/examples/PyMPDATA_examples/Smolarkiewicz_2006_Figs_3_4_10_11_12/__init__.py index 1a6c85fa..8d6a0477 100644 --- a/examples/PyMPDATA_examples/Smolarkiewicz_2006_Figs_3_4_10_11_12/__init__.py +++ b/examples/PyMPDATA_examples/Smolarkiewicz_2006_Figs_3_4_10_11_12/__init__.py @@ -3,5 +3,8 @@ [Smolarkiewicz 2006](https://doi.org/10.1002/fld.1071), depicting infinite-gauge and flux-corrected transport case. +demo.ipynb: +.. include:: ./demo.ipynb.badges.md + ![plot](https://github.com/open-atmos/PyMPDATA/releases/download/tip/fig_4.svg) """ diff --git a/examples/PyMPDATA_examples/Williamson_and_Rasch_1989_as_in_Jaruga_et_al_2015_Fig_14/__init__.py b/examples/PyMPDATA_examples/Williamson_and_Rasch_1989_as_in_Jaruga_et_al_2015_Fig_14/__init__.py index 08a67c65..e973f940 100644 --- a/examples/PyMPDATA_examples/Williamson_and_Rasch_1989_as_in_Jaruga_et_al_2015_Fig_14/__init__.py +++ b/examples/PyMPDATA_examples/Williamson_and_Rasch_1989_as_in_Jaruga_et_al_2015_Fig_14/__init__.py @@ -3,4 +3,7 @@ [Williamson and Rasch 1989](https://doi.org/10.1175/1520-0493(1989)117%3C0102:TDSLTW%3E2.0.CO;2). It demonstrates the use of `PyMPDATA.solver.g_factor` to transform the advection problem onto a sphere. + +demo_over_the_pole.ipynb: +.. include:: ./demo_over_the_pole.ipynb.badges.md """ diff --git a/examples/PyMPDATA_examples/advection_diffusion_1d/__init__.py b/examples/PyMPDATA_examples/advection_diffusion_1d/__init__.py index 41e31c95..c5e53dba 100644 --- a/examples/PyMPDATA_examples/advection_diffusion_1d/__init__.py +++ b/examples/PyMPDATA_examples/advection_diffusion_1d/__init__.py @@ -1,4 +1,6 @@ """ -PyMPDATA 1D advection-diffusion example with error analysis -for different initial parameters. +PyMPDATA 1D advection-diffusion example with error analysis for different initial parameters. + +demo.ipynb: +.. include:: ./demo.ipynb.badges.md """ diff --git a/examples/PyMPDATA_examples/advection_diffusion_2d/__init__.py b/examples/PyMPDATA_examples/advection_diffusion_2d/__init__.py index 8412e802..10e46f3f 100644 --- a/examples/PyMPDATA_examples/advection_diffusion_2d/__init__.py +++ b/examples/PyMPDATA_examples/advection_diffusion_2d/__init__.py @@ -1,3 +1,6 @@ """ PyMPDATA 2D advection-diffusion example with gif creation. + +advection-diffusion-2d.ipynb: +.. include:: ./advection-diffusion-2d.ipynb.badges.md """ diff --git a/examples/PyMPDATA_examples/advection_diffusion_2d/advection-diffusion-2d.ipynb b/examples/PyMPDATA_examples/advection_diffusion_2d/advection-diffusion-2d.ipynb index 5a9079ba..1e4c346c 100644 --- a/examples/PyMPDATA_examples/advection_diffusion_2d/advection-diffusion-2d.ipynb +++ b/examples/PyMPDATA_examples/advection_diffusion_2d/advection-diffusion-2d.ipynb @@ -473,7 +473,7 @@ "outputs": [], "source": [ "def merge_images_into_gif(image_folder, gif_name, duration=0.01):\n", - " with imageio.get_writer(gif_name, mode='I', duration=duration) as writer:\n", + " with imageio.get_writer(gif_name, mode='I', duration=duration, loop=0) as writer:\n", " for filename in sorted(os.listdir(image_folder)):\n", " image = imageio.v3.imread(os.path.join(image_folder, filename))\n", " writer.append_data(image)" diff --git a/examples/README.md b/examples/README.md index aa6478ec..75c57dcf 100644 --- a/examples/README.md +++ b/examples/README.md @@ -4,53 +4,6 @@ [![PyPI version](https://badge.fury.io/py/PyMPDATA-examples.svg)](https://pypi.org/project/PyMPDATA-examples) [![API docs](https://img.shields.io/badge/API_docs-pdoc3-blue.svg)](https://open-atmos.github.io/PyMPDATA-examples/) -Each of the examples listed below can either be executed using Jupyer after downaloding it (and installing - the PySDM-examples package using ``pip install``) or executed in the cloud by clicking on one of the - Mybinder or Colab badges below: - -- [Smolarkiewicz 2006](http://doi.org/10.1002/fld.1071) Figs 3,4,10,11 & 12 - [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/PyMPDATA.git/main?urlpath=lab/tree/examples/PyMPDATA_examples%2FSmolarkiewicz_2006_Figs_3_4_10_11_12/demo.ipynb) - [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PyMPDATA/blob/main/examples/PyMPDATA_examples/Smolarkiewicz_2006_Figs_3_4_10_11_12/demo.ipynb) - (1D homogeneous cases depicting infinite-gauge and flux-corrected transport cases) -- [Arabas & Farhat 2020](https://doi.org/10.1016/j.cam.2019.05.023) (1D advection-diffusion example based on Black-Scholes equation): - - Fig 1: - [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/PyMPDATA.git/main?urlpath=lab/tree/examples/PyMPDATA_examples%2FArabas_and_Farhat_2020/fig_1.ipynb) - [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PyMPDATA/blob/main/examples/PyMPDATA_examples/Arabas_and_Farhat_2020/fig_1.ipynb) - - Fig 2: - [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/PyMPDATA.git/main?urlpath=lab/tree/examples/PyMPDATA_examples%2FArabas_and_Farhat_2020/fig_2.ipynb) - [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PyMPDATA/blob/main/examples/PyMPDATA_examples/Arabas_and_Farhat_2020/fig_2.ipynb) - - Fig 3: - [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/PyMPDATA.git/main?urlpath=lab/tree/examples/PyMPDATA_examples%2FArabas_and_Farhat_2020/fig_3.ipynb) - [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PyMPDATA/blob/main/examples/PyMPDATA_examples/Arabas_and_Farhat_2020/fig_3.ipynb) - - Tab 1: - [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/PyMPDATA.git/main?urlpath=lab/tree/examples/PyMPDATA_examples%2FArabas_and_Farhat_2020/tab_1.ipynb) - [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PyMPDATA/blob/main/examples/PyMPDATA_examples/Arabas_and_Farhat_2020/tab_1.ipynb) -- [Olesik et al. 2022](https://doi.org/10.5194/gmd-15-3879-2022) - [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/PyMPDATA.git/main?urlpath=lab/tree/examples/PyMPDATA_examples%2FOlesik_et_al_2022/) - [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PyMPDATA/blob/main/examples/PyMPDATA_examples/Olesik_et_al_2022/demo_make_plots.ipynb) - (1D particle population condensational growth problem with coordinate transformations) -- [Shipway and Hill 2012 (KiD-1D)](https://doi.org/10.1002/qj.1913) (analysis discussed in [Olesik et al. 2022](https://arxiv.org/abs/2011.14726)) - [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/PyMPDATA.git/main?urlpath=lab/tree/examples/PyMPDATA_examples%2FShipway_and_Hill_2012/) - [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PyMPDATA/blob/main/examples/PyMPDATA_examples/Shipway_and_Hill_2012/fig_1.ipynb) - (2D spectral-spatial problem of droplet condensational growth in a column of air) -![animation](https://github.com/open-atmos/PyMPDATA/wiki/files/KiD-1D_PyMPDATA_n_iters=1.gif) -![animation](https://github.com/open-atmos/PyMPDATA/wiki/files/KiD-1D_PyMPDATA_n_iters=3.gif) -- Molenkamp 2D solid-body rotation test (as in [Jaruga et al. 2015](https://doi.org/10.5194/gmd-8-1005-2015), Fig. 12) - [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/PyMPDATA.git/main?urlpath=lab/tree/examples/PyMPDATA_examples%2FMolenkamp_test_as_in_Jaruga_et_al_2015_Fig_12/demo.ipynb) - [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PyMPDATA/blob/main/examples/PyMPDATA_examples/Molenkamp_test_as_in_Jaruga_et_al_2015_Fig_12/demo.ipynb) -- 1D advection-diffusion example with animation - [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/PyMPDATA.git/main?urlpath=lab/tree/examples/PyMPDATA_examples%2Fadvection_diffusion_1d/demo.ipynb) - [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PyMPDATA/blob/main/examples/PyMPDATA_examples/advection_diffusion_1d/demo.ipynb) -- 2D advection-diffusion example with visualization - [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/PyMPDATA.git/main?urlpath=lab/tree/examples/PyMPDATA_examples%2Fadvection_diffusion_2d/advection-diffusion-2d.ipynb) - [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PyMPDATA/blob/main/examples/PyMPDATA_examples/advection_diffusion_2d/advection-diffusion-2d.ipynb) -- 2D shallow-water equations (3D elliptic drop spreading on 2D plane under gravity example from [Jarecka et al. 2015](https://doi.org/10.1016/j.jcp.2015.02.003)) - - Fig 6: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/PyMPDATA.git/main?urlpath=lab/tree/examples/PyMPDATA_examples/Jarecka_et_al_2015/fig_6.ipynb) - [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PyMPDATA/blob/main/examples/PyMPDATA_examples/Jarecka_et_al_2015/fig_6.ipynb) -- 2D advection on a sphere (setup depicting coordinate transformation based on [Williamson and Rasch 1989](https://doi.org/10.1175/1520-0493(1989)117%3C0102:TDSLTW%3E2.0.CO;2)) - [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/PyMPDATA.git/main?urlpath=lab/tree/examples/PyMPDATA_examples%2FWilliamson_and_Rasch_1989_as_in_Jaruga_et_al_2015_Fig_14/demo_over_the_pole.ipynb) - [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PyMPDATA/blob/main/examples/PyMPDATA_examples/Williamson_and_Rasch_1989_as_in_Jaruga_et_al_2015_Fig_14/demo_over_the_pole.ipynb) -![animation](https://github.com/open-atmos/PyMPDATA/wiki/files/sphere_upwind.gif) -- 3D advection (spherical signal revolving in a box, based on [Smolarkiewicz 1984](https://doi.org/10.1016/0021-9991(84)90121-9)) - [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/PyMPDATA.git/main?urlpath=lab/tree/examples/PyMPDATA_examples%2FSmolarkiewicz_1984/figs_13-14.ipynb) - [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PyMPDATA/blob/main/examples/PyMPDATA_examples/Smolarkiewicz_1984/figs_13-14.ipynb) +For a list of examples, see [PyMPDATA-examples documentation](https://open-atmos.github.io/PyMPDATA/PyMPDATA_examples.html). + +For information on package development, see [PyMPDATA README](https://github.com/open-atmos/PyMPDATA/blob/main/README.md). diff --git a/examples/setup.py b/examples/setup.py index 9b8678d7..f95dabed 100644 --- a/examples/setup.py +++ b/examples/setup.py @@ -1,15 +1,20 @@ """ the magick behind ``pip install ...`` """ import os +import re from setuptools import find_packages, setup def get_long_description(): - """returns contents of README.md file""" - with open("README.md", "r", encoding="utf8") as file: - long_description = file.read() - return long_description + """returns contents of the pdoc landing site with pdoc links converted into URLs""" + with open( + "../docs/markdown/pympdata_examples_landing.md", "r", encoding="utf8" + ) as file: + pdoc_links = re.compile( + r"(`)([\w\d_-]*).([\w\d_-]*)(`)", re.MULTILINE | re.UNICODE + ) + return pdoc_links.sub(r'\3', file.read()) CI = "CI" in os.environ