Skip to content

Commit

Permalink
Merge branch 'master' into column_model_pr
Browse files Browse the repository at this point in the history
  • Loading branch information
ntlewis authored May 31, 2022
2 parents 4ed1f2c + e11f5ed commit 24c47d0
Show file tree
Hide file tree
Showing 84 changed files with 5,911 additions and 474 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: docs

on:
push:
branches: [ master ]
paths:
- '.github/workflows/docs.yml'
- 'docs/**'
- 'src/**'

env:
GFDL_BASE: ${{ github.workspace }}
GFDL_ENV: "ubuntu_conda"
GFDL_WORK: "$HOME/gfdl_work"
GFDL_DATA: "$HOME/gfdl_data"
GFDL_PYDIR: "${{ github.workspace }}/src/extra/python"

jobs:
docs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.9']

steps:
- name: Checkout source
uses: actions/checkout@v2
with:
fetch-depth: 0

# - name: Check environment variables
# run: |
# echo "Testing"
# echo $PWD
# echo $GFDL_BASE
# echo $GFDL_PYDIR
# echo $GITHUB_WORKSPACE
# echo $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID

- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
environment-file: docs/environment.yml
miniforge-variant: Mambaforge
miniforge-version: "latest"
use-mamba: true
activate-environment: isca_docs
auto-activate-base: false

- name: List installed packages
shell: bash -l {0}
run: conda list

- name: Install
shell: bash -l {0}
run: |
cd $GFDL_PYDIR
python -m pip install -e .
cd $GFDL_BASE
- name: Build docs
shell: bash -l {0}
run: |
cd docs/
make html -e
- name: Commit documentation changes
run: |
git clone https://github.com/$GITHUB_REPOSITORY.git --branch gh-pages --single-branch gh-pages
cp -r docs/_build/html/* gh-pages/
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present, so we ignore that.
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
70 changes: 70 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: tests

on:
push:
branches: [ master ]
paths:
- '.github/workflows/tests.yml'
- 'bin/**'
- 'bin/**'
- 'ci/**'
- 'exp/**'
- 'input/**'
- 'src/**'
- 'test/**'
pull_request:
branches: [ master ]
paths:
- '.github/workflows/tests.yml'
- 'bin/**'
- 'ci/**'
- 'exp/**'
- 'input/**'
- 'src/**'
- 'test/**'

env:
GFDL_BASE: ${{ github.workspace }}
GFDL_ENV: "ubuntu_conda"
GFDL_WORK: "${{ github.workspace }}/../gfdl_work"
GFDL_DATA: "${{ github.workspace }}/../gfdl_data"
GFDL_PYDIR: "${{ github.workspace }}/src/extra/python"

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest] # , macos-latest]
python-version: ['3.9']

steps:
- name: Checkout source
uses: actions/checkout@v2

- name: Setup Conda for OS ${{ matrix.os }} and Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
environment-file: ci/environment-py${{ matrix.python-version }}.yml
miniforge-variant: Mambaforge
miniforge-version: "latest"
use-mamba: true
activate-environment: isca_env
auto-activate-base: false

- name: Install
shell: bash -l {0}
run: |
cd $GFDL_PYDIR
python -m pip install -e .
cd $GFDL_BASE
- name: List installed packages
shell: bash -l {0}
run: conda list

- name: Run tests
shell: bash -l {0}
run: |
python -m pytest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ src/atmos_param/socrates/src/trunk*
~*
nohup.out
Makefile
!docs/Makefile
*.DS_Store
._*
*.mod
Expand Down
38 changes: 38 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
cff-version: 1.1.0
authors:
- family-names: Vallis
given-names: Geoffrey K.
orcid: https://orcid.org/0000-0002-5971-8995
- family-names: Colyer
given-names: Greg
- family-names: Geen
given-names: Ruth
- family-names: Gerber
given-names: Edwin
orcid: https://orcid.org/0000-0002-6010-6638
- family-names: Jucker
given-names: Martin
orcid: https://orcid.org/0000-0002-4227-315X
- family-names: Maher
given-names: Penelope
orcid: https://orcid.org/0000-0001-8513-8700
- family-names: Paterson
given-names: Alexander
- family-names: Pietschnig
given-names: Marianne
orcid: https://orcid.org/0000-0002-7405-5536
- family-names: Penn
given-names: James
- family-names: Thomson
given-names: Stephen I.
orcid: https://orcid.org/0000-0002-4775-3259
title: "Isca, v1.0: a framework for the global modelling of the atmospheres of Earth and other planets at varying levels of complexity"
journal: Geoscientific Model Development
volume: 11
year: 2018
number: 3
pages: 843--859
version: v1.0
doi: 10.5194/gmd-11-843-2018
url: https://gmd.copernicus.org/articles/11/843/2018/
date-released: 2018-03-06
64 changes: 50 additions & 14 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,31 @@
[![Build Status](https://travis-ci.com/execlim/Isca.svg?branch=master)](https://travis-ci.com/execlim/Isca)
[![Documentation](https://img.shields.io/badge/docs-latest-green?logo=github)](https://execlim.github.io/Isca)
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg?logo=gnu)](LICENSE)

# Isca
<h1 align="center">
<a href="https://execlim.github.io/Isca">
<img src="docs/source/_static/isca_logo_large.png" alt="Isca" width="300"></a><br>
</h1>

<p align="center">
<a href="https://doi.org/10.5194/gmd-11-843-2018">
<img src="https://img.shields.io/badge/Paper-GMD-orange.svg?logo=data:image/svg%2bxml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzI1IiB3aWR0aD0iNDEwIj4KPGcgc3R5bGU9ImZpbGw6IzAwNzJiYyI+CjxwYXRoIGQ9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LDAgLTQyLjIsLTE4LjkgLTQyLjIsLTQyLjIgMCwtMjMuMyAxOC45LC00Mi4yIDQyLjIsLTQyLjIgOS41LDAgMTguNSwzLjEgMjYsOSBMIDI4NiwxMDguMiBjIC0xMi4yLC05LjUgLTI2LjgsLTE0LjYgLTQyLjMsLTE0LjYgLTM3LjgsMCAtNjguNiwzMC44IC02OC42LDY4LjYgMCwzNy44IDMwLjgsNjguNiA2OC42LDY4LjYgMTUuNSwwIDMwLjEsLTUgNDIuMywtMTQuNiBsIDUsLTQgMCwtNjMuNyAtNTcuOSwwIDAsMjYuMiB6Ii8+CjxwYXRoIGQ9Im0gMzgzLjgsOTcuNSAwLDg0LjQgYyAwLDEyLjMgLTEwLDIyLjQgLTIyLjQsMjIuNCAtMTIuMywwIC0yMi40LC0xMCAtMjIuNCwtMjIuNCBsIDAsLTg0LjQgLTI2LjMsMCAwLDg0LjQgYyAwLDI2LjkgMjEuOSw0OC43IDQ4LjcsNDguNyAyNi45LDAgNDguNywtMjEuOSA0OC43LC00OC43IGwgMCwtODQuNCAtMjYuMywwIHoiLz4KPC9nPgo8L3N2Zz4K&logoColor=white"
alt="Python 3.7+"></a>
<a href="https://www.python.org/downloads/">
<img src="https://img.shields.io/badge/python-3.7+-blue.svg?logo=python&logoColor=white"
alt="Python 3.7+"></a>
<a href="https://github.com/psf/black">
<img src="https://img.shields.io/badge/code%20style-black-000000.svg"
alt="black"></a>
<a href="https://github.com/execlim/Isca/actions?query=workflow%3Atests">
<img src="https://github.com/execlim/Isca/workflows/tests/badge.svg"
alt="Tests"></a>
<a href="https://execlim.github.io/Isca">
<img src="https://img.shields.io/badge/docs-latest-green?logo=github"
alt="Documentation"></a>
<a href="LICENSE">
<img src="https://img.shields.io/badge/license-GPL%20v3-blue.svg?logo=gnu"
alt="License: GPL v3"></a>
<a href="https://twitter.com/IscaModel">
<img src="https://img.shields.io/twitter/follow/IscaModel?color=yellow&label=twitter%7CIscaModel&logo=twitter&style=flat"
alt="twitter IscaModel"></a>
</p>

Isca is a framework for the idealized modelling of the global circulation of
planetary atmospheres at varying levels of complexity and realism. The
Expand Down Expand Up @@ -35,26 +58,39 @@ A python module `isca` (note lowercase) is provided alongside the Fortran source

### Installing the `isca` python module

The python module is found in the `src` directory and can be installed using `pip`. It's recommended that you use some sort of python environment manager to do this, such as using a conda distribution and creating an environment (in the code below called "`isca_env`"), or using `virtualenv` instead. This "getting started" will show you how to create a python environment that includes Isca's required packages, and then install the model.

1. **Install [Miniforge](https://github.com/conda-forge/miniforge)**

*Recommended step*: Some workstations may have outdated default python and conda installations, which may cause conflicts during installation. As a lightweight solution to get up-to-date installations, we recommend downloading [Miniforge](https://github.com/conda-forge/miniforge).
To ensure this works as expected, check that `$PYTHONPATH` is unset and that your `.bashrc` does not contain `module load` statements that may cause conda conflicts.

*If you have a recent conda version installed in your home directory already you may wish to skip this step.*

2. **Check out or download this repository**

To begin you'll need a copy of the source code. Either fork the Isca repository to your own github username, or clone directly from the ExeClim group.

```{bash}
$ git clone https://github.com/ExeClim/Isca
$ cd Isca
```

The python module is found in the `src` directory and can be installed using `pip`. It's recommended (but not essential) that you use some sort of python environment manager to do this, such as using the Anaconda distribution and creating an environment (in the code below called "`isca_env`"), or using `virtualenv` instead. This getting started will use Anaconda.
3. **Create a conda environment**

Requirements for Isca can be installed via the .yml file included with the model in `Isca/ci/environment-py3.9.yml`
Navigate to the downloaded Isca folder, and create a conda environment `isca_env` containing the required packages using:
```{bash}
$ conda create -n isca_env python ipython
...
$ source activate isca_env
(isca_env)$ cd src/extra/python
(isca_env)$ pip install -r requirements.txt
...
Successfully installed MarkupSafe-1.0 f90nml jinja2-2.9.6 numpy-1.13.3 pandas-0.21.0 python-dateutil-2.6.1 pytz-2017.3 sh-1.12.14 six-1.11.0 xarray-0.9.6
$ conda env create -f ci/environment-py3.9.yml
```
Then activate the environment; you'll need to do this each time you launch a new bash session.
```{bash}
$ conda activate isca_env
```

4. **Install the model**

Now install the `isca` python module in "development mode". This will allow you, if you wish, to edit the `src/extra/python/isca` files and have those changes be used when you next run an Isca script.
Now install the `isca` python module in "development mode". This will allow you, if you wish, to edit the `src/extra/python/isca` files and have those changes be used when you next run an Isca script. Navigate to `Isca/src/extra/python/` and run:

```{bash}
(isca_env)$ pip install -e .
Expand Down
2 changes: 1 addition & 1 deletion ci/environment_py37.yml → ci/environment-py3.9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
- numpy
- openmpi
- pandas
- python=3.7
- python=3.9
- pip
- pytest
- sh
Expand Down
8 changes: 4 additions & 4 deletions .travis.yml → deprecated/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ branches:
env:
global:
- GFDL_BASE=$TRAVIS_BUILD_DIR
- GFDL_ENV="$TRAVIS_BUILD_DIR/src/extra/env/ubuntu_conda"
- GFDL_ENV="ubuntu_conda"
- GFDL_WORK="$HOME/gfdl_work"
- GFDL_DATA="$HOME/gfdl_data"
- GFDL_PYDIR="$TRAVIS_BUILD_DIR/src/extra/python"
Expand All @@ -18,7 +18,7 @@ env:
matrix:
fast_finish: true
include:
- env: CONDA_ENV=docs
# - env: CONDA_ENV=docs
- env: CONDA_ENV=py37

before_install:
Expand All @@ -37,7 +37,7 @@ install:
else
conda env create -n test_env --file ci/environment_$CONDA_ENV.yml;
fi;
- source $GFDL_ENV
- source $TRAVIS_BUILD_DIR/src/extra/env/$GFDL_ENV
- source $HOME/miniconda/etc/profile.d/conda.sh
- conda activate test_env
- conda list
Expand All @@ -49,7 +49,7 @@ script:
- if [[ "$CONDA_ENV" == "docs" ]]; then
sphinx-build -n -b html -d docs/_build/doctrees docs/source docs/_build/html;
else
pytest -v;
travis_wait 30 pytest -v;
fi;

after_success:
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions deprecated/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Files in this directory will be deleted in the next release.
File renamed without changes.
19 changes: 19 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS = -d _build/doctrees
SPHINXBUILD = sphinx-build
SOURCEDIR = source
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2 changes: 1 addition & 1 deletion docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
- numpy
- openmpi
- pandas
- python=3.7
- python=3.9
- pip
- pytest
- sh
Expand Down
Loading

0 comments on commit 24c47d0

Please sign in to comment.