Skip to content

Commit

Permalink
Merge pull request #258 from lettlini/notebook_workflow
Browse files Browse the repository at this point in the history
Actions for Generating and Checking Jupyter Notebooks
  • Loading branch information
w-k-jones authored May 24, 2023
2 parents 75cd959 + a674251 commit 594277e
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/check_notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Jupyter Notebooks CI
on: [push, pull_request]
jobs:
Check-Notebooks:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- name: check out repository code
uses: actions/checkout@v3
- name: set up conda environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
auto-activate-base: false
activate-environment: notebook-env
- name: Install tobac dependencies
run: |
conda install -c conda-forge --yes ffmpeg gcc jupyter pytables
conda install -c conda-forge --yes --file requirements.txt
- name: Install tobac
run: |
pip install .
- name: Find all notebook files
run: |
find . -type f -name '*.ipynb' > nbfiles.txt
cat nbfiles.txt
- name: Execute all notebook files
run: |
while IFS= read -r nbpath; do
jupyter nbconvert --inplace --ClearMetadataPreprocessor.enabled=True --clear-output $nbpath
jupyter nbconvert --to notebook --inplace --execute $nbpath
done < nbfiles.txt
48 changes: 48 additions & 0 deletions .github/workflows/generate_notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Generate Jupyter Notebooks
on:
pull_request:
types:
- closed
workflow_dispatch:
jobs:
Generate-Notebooks:
if: (github.event.pull_request.merged == true) || (github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
permissions:
contents: write
defaults:
run:
shell: bash -el {0}
steps:
- name: check out repository code
uses: actions/checkout@v3
- name: set up conda environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
auto-activate-base: false
activate-environment: notebook-env
- name: Install tobac dependencies
run: |
conda install -c conda-forge --yes ffmpeg gcc jupyter pytables
conda install -c conda-forge --yes --file requirements.txt
- name: Install tobac
run: |
pip install .
- name: Find all notebook files
run: |
find . -type f -name '*.ipynb' > nbfiles.txt
cat nbfiles.txt
- name: Execute all notebook files
run: |
while IFS= read -r nbpath; do
jupyter nbconvert --inplace --ClearMetadataPreprocessor.enabled=True --clear-output $nbpath
jupyter nbconvert --to notebook --inplace --execute $nbpath
done < nbfiles.txt
- name: Commit changed notebooks
run: |
git config user.name github-actions
git config user.email github-actions@github.com
find . -type f -name "*.ipynb" -exec git add {} +
git commit -m "Generated Notebooks"
git push
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
tobac - Tracking and Object-based Analysis of Clouds
======
[![Documentation Status](https://readthedocs.org/projects/tobac/badge/?version=latest)](https://tobac.readthedocs.io/en/latest/?badge=latest)[![Download Counter](https://anaconda.org/conda-forge/tobac/badges/downloads.svg)](https://anaconda.org/conda-forge/tobac/)
[![Release Version](https://img.shields.io/conda/vn/conda-forge/tobac.svg)](https://anaconda.org/conda-forge/tobac)[![Download Counter](https://img.shields.io/conda/dn/conda-forge/tobac.svg)](https://anaconda.org/conda-forge/tobac)[![Documentation Status](https://readthedocs.org/projects/tobac/badge/?version=latest)](https://tobac.readthedocs.io/en/latest/?badge=latest)

What is it?
-----------

*tobac* is a Python package for identifiying, tracking and analysing of clouds and other meteorological phenomena in different types of gridded datasets. *tobac* is unique in its ability to track phenomena using **any** variable on **any** grid, including radar data, satellite observations, and numerical model output. *tobac* has been used in a variety of peer-reviewed [publications](https://tobac.readthedocs.io/en/rc_v1.4.0/publications.html) and is an international, multi-institutional collaboration.
*tobac* is a Python package for identifiying, tracking and analysing of clouds and other meteorological phenomena in different types of gridded datasets. *tobac* is unique in its ability to track phenomena using **any** variable on **any** grid, including radar data, satellite observations, and numerical model output. *tobac* has been used in a variety of peer-reviewed [publications](https://tobac.readthedocs.io/en/latest/publications.html) and is an international, multi-institutional collaboration.

Documentation
-------------
Expand Down

0 comments on commit 594277e

Please sign in to comment.