diff --git a/.github/workflows/sphinx_build_deploy.yml b/.github/workflows/sphinx_build_deploy.yml new file mode 100644 index 0000000..fe90b22 --- /dev/null +++ b/.github/workflows/sphinx_build_deploy.yml @@ -0,0 +1,58 @@ +name: Publish Sphinx Built Webpages to Github Pages + +on: + push: + branches: + - master + paths: + - 'docs/**' + - 'examples/**' + +jobs: + release: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + +# Caching works, but then it reinstalls the regular dependencies anyway, so defeats the purpose of caching. +# - name: Install pip +# run: | +# python -m pip install --upgrade pip + +# - name: Get pip cache dir +# id: pip-cache +# run : echo "::set-output name=dir::$(pip cache dir)" + +# - name: Cache dependencies +# uses: actions/cache@v1 +# with: +# path: ${{ steps.pip-cache.outputs.dir }} +# key: ${{ runner.os }}-pip-${{ hashFiles('**/docs/requirements.txt') }} +# restore-keys: | +# ${{ runner.os }}-pip- + + - name: Install dependencies + run: | + sudo apt install pandoc + python -m pip install --upgrade pip + pip install -r docs/requirements.txt + + - name: Install ReadTheDocs theme + run: | + pip install sphinx_rtd_theme + + - name: Build Sphinx documentation + run: | + cd docs + make html + + - name: Deploy to gh-pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/build/html diff --git a/docs/requirements.txt b/docs/requirements.txt index 282356c..cc19438 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -3,3 +3,4 @@ nbconvert>=4.1 enum34 jupyter shapely +numpy diff --git a/docs/source/index.rst b/docs/source/index.rst index d03f78d..237af52 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -11,20 +11,25 @@ The python-awips package provides a data access framework for requesting grid an Pip Install ----------- -- pip install python-awips +:: + + pip install python-awips + Conda Environment Install ------------------------- To install the latest version of python-awips, with all required and optional packages: -- git clone https://github.com/Unidata/python-awips.git -- cd python-awips -- conda env create -f environment.yml -- conda activate python3-awips -- conda update - -all -- python setup.py install - -force -- jupyter notebook examples +:: + + git clone https://github.com/Unidata/python-awips.git + cd python-awips + conda env create -f environment.yml + conda activate python3-awips + python setup.py install --force + jupyter notebook examples + Requirements ------------ diff --git a/examples/notebooks/Colored_Surface_Temperature_Plot.ipynb b/examples/notebooks/Colored_Surface_Temperature_Plot.ipynb index cf86623..4b10da3 100644 --- a/examples/notebooks/Colored_Surface_Temperature_Plot.ipynb +++ b/examples/notebooks/Colored_Surface_Temperature_Plot.ipynb @@ -1,14 +1,5 @@ { "cells": [ - { - "cell_type": "code", - "execution_count": 63, - "metadata": {}, - "outputs": [], - "source": [ - "%matplotlib inline" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -53,6 +44,7 @@ "from cartopy.feature import ShapelyFeature\n", "from shapely.geometry import Polygon\n", "from metpy.plots import StationPlot\n", + "%matplotlib inline\n", "\n", "# CONUS bounding box and envelope geometry\n", "bbox=[-120, -70, 15, 55]\n", diff --git a/examples/notebooks/METAR_Station_Plot_with_MetPy.ipynb b/examples/notebooks/METAR_Station_Plot_with_MetPy.ipynb index 474d05b..9a53894 100644 --- a/examples/notebooks/METAR_Station_Plot_with_MetPy.ipynb +++ b/examples/notebooks/METAR_Station_Plot_with_MetPy.ipynb @@ -1,14 +1,5 @@ { "cells": [ - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "%matplotlib inline" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -33,6 +24,7 @@ "from metpy.plots import StationPlot, StationPlotLayout\n", "from metpy.units import units\n", "import warnings\n", + "%matplotlib inline\n", "warnings.filterwarnings(\"ignore\",category =RuntimeWarning)\n", "\n", "def get_cloud_cover(code):\n", diff --git a/examples/notebooks/Regional_Surface_Obs_Plot.ipynb b/examples/notebooks/Regional_Surface_Obs_Plot.ipynb index 9bfe3a0..30aa2d7 100644 --- a/examples/notebooks/Regional_Surface_Obs_Plot.ipynb +++ b/examples/notebooks/Regional_Surface_Obs_Plot.ipynb @@ -1,14 +1,5 @@ { "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "%matplotlib inline" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -35,6 +26,7 @@ "from metpy.calc import wind_components\n", "from metpy.plots import simple_layout, StationPlot, StationPlotLayout\n", "import warnings\n", + "%matplotlib inline\n", "\n", "def get_cloud_cover(code):\n", " if 'OVC' in code:\n",