mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-23 14:57:56 -05:00
Merge pull request #21 from srcarter3/master
Changes made to support automatically build and deployment of documentation website Add a new directory and yml file for the auto-build/deployment: .github/workflows/ dir was created sphinx_build_deploy.yml was created which is triggered when a change is made to the docs/ or examples/ directories. This action builds the html pages using sphinx and then deploys them to our webpage by pushing them into the gh-pages branch Updated the docs/requirements.txt file to include numpy so sphinx can build all the pages properly Modified the index.rst page to have some of the environment install instructions in code blocks instead of a bulleted list Updated notebooks to have the '%matplotlib inline' call after the imports in the code so that the webpage renders properly: Colored_Surface_Tempertature_Plot.ipynb METAR_Station_Plot_with_MetPy.ipynb Regional_Surface_Obs_Plot.ipynb
This commit is contained in:
commit
e356f47129
6 changed files with 75 additions and 35 deletions
58
.github/workflows/sphinx_build_deploy.yml
vendored
Normal file
58
.github/workflows/sphinx_build_deploy.yml
vendored
Normal file
|
@ -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
|
|
@ -3,3 +3,4 @@ nbconvert>=4.1
|
||||||
enum34
|
enum34
|
||||||
jupyter
|
jupyter
|
||||||
shapely
|
shapely
|
||||||
|
numpy
|
||||||
|
|
|
@ -11,20 +11,25 @@ The python-awips package provides a data access framework for requesting grid an
|
||||||
Pip Install
|
Pip Install
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
- pip install python-awips
|
::
|
||||||
|
|
||||||
|
pip install python-awips
|
||||||
|
|
||||||
|
|
||||||
Conda Environment Install
|
Conda Environment Install
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
To install the latest version of python-awips, with all required and optional packages:
|
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
|
git clone https://github.com/Unidata/python-awips.git
|
||||||
- conda activate python3-awips
|
cd python-awips
|
||||||
- conda update - -all
|
conda env create -f environment.yml
|
||||||
- python setup.py install - -force
|
conda activate python3-awips
|
||||||
- jupyter notebook examples
|
python setup.py install --force
|
||||||
|
jupyter notebook examples
|
||||||
|
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
|
|
@ -1,14 +1,5 @@
|
||||||
{
|
{
|
||||||
"cells": [
|
"cells": [
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": 63,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"%matplotlib inline"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
@ -53,6 +44,7 @@
|
||||||
"from cartopy.feature import ShapelyFeature\n",
|
"from cartopy.feature import ShapelyFeature\n",
|
||||||
"from shapely.geometry import Polygon\n",
|
"from shapely.geometry import Polygon\n",
|
||||||
"from metpy.plots import StationPlot\n",
|
"from metpy.plots import StationPlot\n",
|
||||||
|
"%matplotlib inline\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# CONUS bounding box and envelope geometry\n",
|
"# CONUS bounding box and envelope geometry\n",
|
||||||
"bbox=[-120, -70, 15, 55]\n",
|
"bbox=[-120, -70, 15, 55]\n",
|
||||||
|
|
|
@ -1,14 +1,5 @@
|
||||||
{
|
{
|
||||||
"cells": [
|
"cells": [
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": null,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"%matplotlib inline"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
@ -33,6 +24,7 @@
|
||||||
"from metpy.plots import StationPlot, StationPlotLayout\n",
|
"from metpy.plots import StationPlot, StationPlotLayout\n",
|
||||||
"from metpy.units import units\n",
|
"from metpy.units import units\n",
|
||||||
"import warnings\n",
|
"import warnings\n",
|
||||||
|
"%matplotlib inline\n",
|
||||||
"warnings.filterwarnings(\"ignore\",category =RuntimeWarning)\n",
|
"warnings.filterwarnings(\"ignore\",category =RuntimeWarning)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"def get_cloud_cover(code):\n",
|
"def get_cloud_cover(code):\n",
|
||||||
|
|
|
@ -1,14 +1,5 @@
|
||||||
{
|
{
|
||||||
"cells": [
|
"cells": [
|
||||||
{
|
|
||||||
"cell_type": "code",
|
|
||||||
"execution_count": 1,
|
|
||||||
"metadata": {},
|
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
|
||||||
"%matplotlib inline"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
|
@ -35,6 +26,7 @@
|
||||||
"from metpy.calc import wind_components\n",
|
"from metpy.calc import wind_components\n",
|
||||||
"from metpy.plots import simple_layout, StationPlot, StationPlotLayout\n",
|
"from metpy.plots import simple_layout, StationPlot, StationPlotLayout\n",
|
||||||
"import warnings\n",
|
"import warnings\n",
|
||||||
|
"%matplotlib inline\n",
|
||||||
"\n",
|
"\n",
|
||||||
"def get_cloud_cover(code):\n",
|
"def get_cloud_cover(code):\n",
|
||||||
" if 'OVC' in code:\n",
|
" if 'OVC' in code:\n",
|
||||||
|
|
Loading…
Add table
Reference in a new issue