Skip to content

Commit

Permalink
Merge branch 'release-v0.1.0' into W2D3_curriculum_specialist_updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nsea-log authored Apr 8, 2024
2 parents 1677743 + 0163bbd commit ba27bf2
Show file tree
Hide file tree
Showing 93 changed files with 3,759 additions and 2,504 deletions.
5 changes: 3 additions & 2 deletions .github/actions/check-notebooks/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ runs:
- name: Get notebooks
run: |
if ${{ inputs.run_all == 'true' }}; then
nbs="tutorials/*/*Tutorial*.ipynb";
# nbs="tutorials/W2D4_*/*Tutorial*.ipynb";
# nbs="tutorials/*/*Tutorial*.ipynb";
nbs="tutorials/W1D4_*/*Tutorial*.ipynb";
else
nbs=`python ci/select_notebooks.py ${{ steps.changes.outputs.files }}`;
fi
Expand Down Expand Up @@ -94,6 +94,7 @@ runs:
if: ${{ env.NBS != '' }}
id: verify_exercises
run: |
pip install fuzzywuzzy
python ci/verify_exercises.py ${{ env.NBS }} --c "$COMMIT_MESSAGE"
shell: bash -l {0}

Expand Down
183 changes: 92 additions & 91 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,35 @@ inputs:
runs:
using: composite
steps:
# - name: Set up Python (conda)
# uses: conda-incubator/setup-miniconda@v2
# with:
# miniforge-variant: Mambaforge
# miniforge-version: latest
# activate-environment: climatematch
# use-mamba: true
- name: Set up Python (conda)
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: "3.9"
activate-environment: climatematch
use-mamba: true

- uses: actions/checkout@v2 # This step checks out the repository code
# - uses: actions/checkout@v2 # This step checks out the repository code

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: 3.9

- name: Set up virtual environment
run: |
python -m venv env
source ./env/bin/activate
shell: bash -l {0}
# - name: Set up virtual environment
# run: |
# python -m venv env
# source ./env/bin/activate
# shell: bash -l {0}

# - uses: actions/cache@v3
# with:
# path: /usr/share/miniconda3/envs/climatematch
# # This should create a key that looks like 'linux-64-conda-environment.yml-[HASH]'
# # Logic inspired by https://dev.to/epassaro/caching-anaconda-environments-on-github-actions-2d08
# key: ${{ format('linux-64-conda-environment.yml-{0}', hashFiles('environment.yml') )}}
# id: cache
- uses: actions/cache@v3
with:
path: /usr/share/miniconda3/envs/climatematch
# This should create a key that looks like 'linux-64-conda-environment.yml-[HASH]'
# Logic inspired by https://dev.to/epassaro/caching-anaconda-environments-on-github-actions-2d08
key: ${{ format('linux-64-conda-environment.yml-{0}', hashFiles('environment.yml') )}}
id: cache

- name: Get commit message
run: |
Expand All @@ -57,82 +58,82 @@ runs:
echo ci/ >> .gitignore
shell: bash -l {0}

- name: Install numpy
run: |
pip install numpy
shell: bash -l {0}
# - name: Install numpy
# run: |
# pip install numpy
# shell: bash -l {0}

- name: Install GEOS/Proj (dep for cartopy)
run: |
sudo apt update
sudo apt install libgeos++-dev libgeos3.10.2 libgeos-c1v5 libgeos-dev libgeos-doc
sudo apt-get install proj-bin libproj-dev proj-data
shell: bash -l {0}
# - name: Install GEOS/Proj (dep for cartopy)
# run: |
# sudo apt update
# sudo apt install libgeos++-dev libgeos3.10.2 libgeos-c1v5 libgeos-dev libgeos-doc
# sudo apt-get install proj-bin libproj-dev proj-data
# shell: bash -l {0}


- name: Install HDF5 (dep for netCDF4)
run: |
sudo apt-get install libhdf5-serial-dev netcdf-bin libnetcdf-dev
shell: bash -l {0}
# - name: Install HDF5 (dep for netCDF4)
# run: |
# sudo apt-get install libhdf5-serial-dev netcdf-bin libnetcdf-dev
# shell: bash -l {0}

- name: Build/Install esmf/esmpy/xesmf
run: |
wget https://github.com/esmf-org/esmf/archive/refs/tags/v8.6.0.zip
unzip v8.6.0.zip
cd esmf-8.6.0
export ESMF_DIR=$(pwd)
make
# Append ENV VAR to GH ENV so that vars can persist between runs
ESMFMKFILE=$(find $(pwd) -name 'esmf.mk')
echo "ESMFMKFILE=$ESMFMKFILE" >> $GITHUB_ENV
echo $ESMFMKFILE
sudo apt install mpich
pip install mpi4py nose
# cd src/addon/ESMPy
cd src/addon/esmpy
pip install -U numpy
python3 -m pip install .
cd ../../../
pip install git+https://github.com/pangeo-data/xesmf.git
shell: bash -l {0}
# - name: Build/Install esmf/esmpy/xesmf
# run: |
# wget https://github.com/esmf-org/esmf/archive/refs/tags/v8.6.0.zip
# unzip v8.6.0.zip
# cd esmf-8.6.0
# export ESMF_DIR=$(pwd)
# make
# # Append ENV VAR to GH ENV so that vars can persist between runs
# ESMFMKFILE=$(find $(pwd) -name 'esmf.mk')
# echo "ESMFMKFILE=$ESMFMKFILE" >> $GITHUB_ENV
# echo $ESMFMKFILE
# sudo apt install mpich
# pip install mpi4py nose
# # cd src/addon/ESMPy
# cd src/addon/esmpy
# pip install -U numpy
# python3 -m pip install .
# cd ../../../
# pip install git+https://github.com/pangeo-data/xesmf.git
# shell: bash -l {0}

# Necessary for SDFC to work
- name: Install eigen/SDFC
run: |
sudo apt-get install -y libeigen3-dev
echo "CC=gcc-9" >> $GITHUB_ENV
echo "CXX=g++-9" >> $GITHUB_ENV
# echo "/usr/bin/gcc-9" >> $GITHUB_PATH
# echo "/usr/bin/g++-9" >> $GITHUB_PATH
pip install pybind11
git clone https://github.com/neuromatch/SDFC-python.git
cd SDFC-python
python setup.py install
pip show SDFC
cd ..
shell: bash -l {0}
# # Necessary for SDFC to work
# - name: Install eigen/SDFC
# run: |
# sudo apt-get install -y libeigen3-dev
# echo "CC=gcc-9" >> $GITHUB_ENV
# echo "CXX=g++-9" >> $GITHUB_ENV
# # echo "/usr/bin/gcc-9" >> $GITHUB_PATH
# # echo "/usr/bin/g++-9" >> $GITHUB_PATH
# pip install pybind11
# git clone https://github.com/neuromatch/SDFC-python.git
# cd SDFC-python
# python setup.py install
# pip show SDFC
# cd ..
# shell: bash -l {0}

- name: Update environment
if: ${{steps.cache.outputs.cache-hit != 'true' || inputs.force_env_update == 'true'}}
run: |
# mamba env update -n climatematch -f environment.yml
pip install -r ci/requirements.txt
pip install -r requirements.txt
pip install requests aiohttp
pip install jupyter-book==0.14.0 ghp-import cftime pyleoclim importlib-metadata==4.13.0
mamba env update -n climatematch -f environment.yml
# pip install -r ci/requirements.txt
# pip install -r requirements.txt
# pip install requests aiohttp
# pip install jupyter-book==0.14.0 ghp-import cftime pyleoclim importlib-metadata==4.13.0
# pip install climlab==0.8.2
shell: bash -l {0}

- name: Build climlab from source
run: |
git clone https://github.com/climlab/climlab.git
cd climlab
pip install . --no-deps -vv
pip show climlab
cd ..
git clone https://github.com/climlab/climlab-rrtmg.git
cd climlab-rrtmg
pip install . --no-deps -vv
pip show climlab-rrtmg
cd ..
shell: bash -l {0}
# - name: Build climlab from source
# run: |
# git clone https://github.com/climlab/climlab.git
# cd climlab
# pip install . --no-deps -vv
# pip show climlab
# cd ..
# git clone https://github.com/climlab/climlab-rrtmg.git
# cd climlab-rrtmg
# pip install . --no-deps -vv
# pip show climlab-rrtmg
# cd ..
# shell: bash -l {0}
1 change: 1 addition & 0 deletions .github/workflows/notebook-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:

runs-on: ubuntu-latest
# runs-on: ubuntu-20.04
# runs-on: climate_runner
steps:
- name: Free up disk space
uses: jlumbroso/free-disk-space@main
Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ dependencies:
- cartopy
- cdsapi
- cfgrib
- ciso
- ciso # no build for osx-arm64
- climlab
- cmocean
- dask-ml
- datashader
- descartes
- earthaccess
- ecco_v4_py
- ecco_v4_py # no build for osx-arm64
# - eigen # needed for SDFC
- eofs
- erddapy
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ nltk
afinn
mystatsfunctions @ https://github.com/njleach/mystatsfunctions/archive/main.zip
dicelib @ https://github.com/mptouzel/PyDICE/archive/master.zip
cdsapi
2 changes: 1 addition & 1 deletion tutorials/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
| Tutorial 5 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuromatch/climate-course-content/blob/main/tutorials/W1D5_ClimateModeling/student/W1D5_Tutorial5.ipynb) | [![Open In kaggle](https://kaggle.com/static/images/open-in-kaggle.svg)](https://kaggle.com/kernels/welcome?src=https://raw.githubusercontent.com/neuromatch/climate-course-content/main/tutorials/W1D5_ClimateModeling/student/W1D5_Tutorial5.ipynb) | [![View the notebook](https://img.shields.io/badge/render-nbviewer-orange.svg)](https://nbviewer.jupyter.org/github/neuromatch/climate-course-content/blob/main/tutorials/W1D5_ClimateModeling/student/W1D5_Tutorial5.ipynb?flush_cache=true) |
| Tutorial 6 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuromatch/climate-course-content/blob/main/tutorials/W1D5_ClimateModeling/student/W1D5_Tutorial6.ipynb) | [![Open In kaggle](https://kaggle.com/static/images/open-in-kaggle.svg)](https://kaggle.com/kernels/welcome?src=https://raw.githubusercontent.com/neuromatch/climate-course-content/main/tutorials/W1D5_ClimateModeling/student/W1D5_Tutorial6.ipynb) | [![View the notebook](https://img.shields.io/badge/render-nbviewer-orange.svg)](https://nbviewer.jupyter.org/github/neuromatch/climate-course-content/blob/main/tutorials/W1D5_ClimateModeling/student/W1D5_Tutorial6.ipynb?flush_cache=true) |
| Tutorial 7 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuromatch/climate-course-content/blob/main/tutorials/W1D5_ClimateModeling/student/W1D5_Tutorial7.ipynb) | [![Open In kaggle](https://kaggle.com/static/images/open-in-kaggle.svg)](https://kaggle.com/kernels/welcome?src=https://raw.githubusercontent.com/neuromatch/climate-course-content/main/tutorials/W1D5_ClimateModeling/student/W1D5_Tutorial7.ipynb) | [![View the notebook](https://img.shields.io/badge/render-nbviewer-orange.svg)](https://nbviewer.jupyter.org/github/neuromatch/climate-course-content/blob/main/tutorials/W1D5_ClimateModeling/student/W1D5_Tutorial7.ipynb?flush_cache=true) |
| Tutorial 8 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuromatch/climate-course-content/blob/main/tutorials/W1D5_ClimateModeling/student/W1D5_Tutorial8.ipynb) | [![Open In kaggle](https://kaggle.com/static/images/open-in-kaggle.svg)](https://kaggle.com/kernels/welcome?src=https://raw.githubusercontent.com/neuromatch/climate-course-content/main/tutorials/W1D5_ClimateModeling/student/W1D5_Tutorial8.ipynb) | [![View the notebook](https://img.shields.io/badge/render-nbviewer-orange.svg)](https://nbviewer.jupyter.org/github/neuromatch/climate-course-content/blob/main/tutorials/W1D5_ClimateModeling/student/W1D5_Tutorial8.ipynb?flush_cache=true) |
| Outro | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuromatch/climate-course-content/blob/main/tutorials/W1D5_ClimateModeling/W1D5_Outro.ipynb) | [![Open In kaggle](https://kaggle.com/static/images/open-in-kaggle.svg)](https://kaggle.com/kernels/welcome?src=https://raw.githubusercontent.com/neuromatch/climate-course-content/main/tutorials/W1D5_ClimateModeling/W1D5_Outro.ipynb) | [![View the notebook](https://img.shields.io/badge/render-nbviewer-orange.svg)](https://nbviewer.jupyter.org/github/neuromatch/climate-course-content/blob/main/tutorials/W1D5_ClimateModeling/W1D5_Outro.ipynb?flush_cache=true) |


Expand All @@ -122,7 +123,6 @@
| - | --- | --- | ---- |
| Intro | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuromatch/climate-course-content/blob/main/tutorials/W2D1_FutureClimate-IPCCIPhysicalBasis/W2D1_Intro.ipynb) | [![Open In kaggle](https://kaggle.com/static/images/open-in-kaggle.svg)](https://kaggle.com/kernels/welcome?src=https://raw.githubusercontent.com/neuromatch/climate-course-content/main/tutorials/W2D1_FutureClimate-IPCCIPhysicalBasis/W2D1_Intro.ipynb) | [![View the notebook](https://img.shields.io/badge/render-nbviewer-orange.svg)](https://nbviewer.jupyter.org/github/neuromatch/climate-course-content/blob/main/tutorials/W2D1_FutureClimate-IPCCIPhysicalBasis/W2D1_Intro.ipynb?flush_cache=true) |
| Tutorial 1 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuromatch/climate-course-content/blob/main/tutorials/W2D1_FutureClimate-IPCCIPhysicalBasis/student/W2D1_Tutorial1.ipynb) | [![Open In kaggle](https://kaggle.com/static/images/open-in-kaggle.svg)](https://kaggle.com/kernels/welcome?src=https://raw.githubusercontent.com/neuromatch/climate-course-content/main/tutorials/W2D1_FutureClimate-IPCCIPhysicalBasis/student/W2D1_Tutorial1.ipynb) | [![View the notebook](https://img.shields.io/badge/render-nbviewer-orange.svg)](https://nbviewer.jupyter.org/github/neuromatch/climate-course-content/blob/main/tutorials/W2D1_FutureClimate-IPCCIPhysicalBasis/student/W2D1_Tutorial1.ipynb?flush_cache=true) |
| Tutorial 2 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuromatch/climate-course-content/blob/main/tutorials/W2D1_FutureClimate-IPCCIPhysicalBasis/student/W2D1_Tutorial2.ipynb) | [![Open In kaggle](https://kaggle.com/static/images/open-in-kaggle.svg)](https://kaggle.com/kernels/welcome?src=https://raw.githubusercontent.com/neuromatch/climate-course-content/main/tutorials/W2D1_FutureClimate-IPCCIPhysicalBasis/student/W2D1_Tutorial2.ipynb) | [![View the notebook](https://img.shields.io/badge/render-nbviewer-orange.svg)](https://nbviewer.jupyter.org/github/neuromatch/climate-course-content/blob/main/tutorials/W2D1_FutureClimate-IPCCIPhysicalBasis/student/W2D1_Tutorial2.ipynb?flush_cache=true) |
| Tutorial 3 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuromatch/climate-course-content/blob/main/tutorials/W2D1_FutureClimate-IPCCIPhysicalBasis/student/W2D1_Tutorial3.ipynb) | [![Open In kaggle](https://kaggle.com/static/images/open-in-kaggle.svg)](https://kaggle.com/kernels/welcome?src=https://raw.githubusercontent.com/neuromatch/climate-course-content/main/tutorials/W2D1_FutureClimate-IPCCIPhysicalBasis/student/W2D1_Tutorial3.ipynb) | [![View the notebook](https://img.shields.io/badge/render-nbviewer-orange.svg)](https://nbviewer.jupyter.org/github/neuromatch/climate-course-content/blob/main/tutorials/W2D1_FutureClimate-IPCCIPhysicalBasis/student/W2D1_Tutorial3.ipynb?flush_cache=true) |
| Tutorial 4 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuromatch/climate-course-content/blob/main/tutorials/W2D1_FutureClimate-IPCCIPhysicalBasis/student/W2D1_Tutorial4.ipynb) | [![Open In kaggle](https://kaggle.com/static/images/open-in-kaggle.svg)](https://kaggle.com/kernels/welcome?src=https://raw.githubusercontent.com/neuromatch/climate-course-content/main/tutorials/W2D1_FutureClimate-IPCCIPhysicalBasis/student/W2D1_Tutorial4.ipynb) | [![View the notebook](https://img.shields.io/badge/render-nbviewer-orange.svg)](https://nbviewer.jupyter.org/github/neuromatch/climate-course-content/blob/main/tutorials/W2D1_FutureClimate-IPCCIPhysicalBasis/student/W2D1_Tutorial4.ipynb?flush_cache=true) |
| Tutorial 5 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuromatch/climate-course-content/blob/main/tutorials/W2D1_FutureClimate-IPCCIPhysicalBasis/student/W2D1_Tutorial5.ipynb) | [![Open In kaggle](https://kaggle.com/static/images/open-in-kaggle.svg)](https://kaggle.com/kernels/welcome?src=https://raw.githubusercontent.com/neuromatch/climate-course-content/main/tutorials/W2D1_FutureClimate-IPCCIPhysicalBasis/student/W2D1_Tutorial5.ipynb) | [![View the notebook](https://img.shields.io/badge/render-nbviewer-orange.svg)](https://nbviewer.jupyter.org/github/neuromatch/climate-course-content/blob/main/tutorials/W2D1_FutureClimate-IPCCIPhysicalBasis/student/W2D1_Tutorial5.ipynb?flush_cache=true) |
Expand Down
4 changes: 2 additions & 2 deletions tutorials/W1D1_ClimateSystemOverview/W1D1_DaySummary.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"id": "af474117",
"metadata": {},
"source": [
"The tutorials today provided an overview of Earth’s climate system as well as an introduction to Xarray. You learned about long-term, natural forcings and feedbacks that influence Earth’s climate including Earth’s energy budget, orbital forcings and the carbon cycle and explored various processes within the atmospheric, oceanic and terrestrial components of Earth’s climate system. Additionally, you learned useful tools in Xarray for formatting, analyzing and interpreting climate data"
"The tutorials today provided an overview of Earth’s climate system as well as an introduction to Xarray. You learned about long-term, natural forcings and feedbacks that influence Earth’s climate including Earth’s energy budget, orbital forcings, and the carbon cycle, and explored various processes within the atmospheric, oceanic, and terrestrial components of Earth’s climate system. Additionally, you learned useful tools in Xarray for formatting, analyzing, and interpreting climate data."
]
}
],
Expand All @@ -33,7 +33,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.9.18"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit ba27bf2

Please sign in to comment.