Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
kbarnhart committed Aug 1, 2019
2 parents 1d5bad6 + 4a7754e commit 2b2ad53
Show file tree
Hide file tree
Showing 111 changed files with 3,866 additions and 642 deletions.
106 changes: 48 additions & 58 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,41 @@
env:
matrix:
- TRAVIS_PYTHON_VERSION="2.7" BUILD_DOCS=0 REPORT_TO_COVERALLS=0
- TRAVIS_PYTHON_VERSION="3.6" BUILD_DOCS=0 REPORT_TO_COVERALLS=0
- TRAVIS_PYTHON_VERSION="3.7" BUILD_DOCS=0 REPORT_TO_COVERALLS=0
global:
- CONDA_PREFIX=$HOME/miniconda
- MINICONDA_URL_BASE="https://repo.continuum.io/miniconda/Miniconda3-latest"
language: generic
os:
- linux
- osx
env:
matrix:
- CONDA_ENV=3.7
- CONDA_ENV=3.6
global:
- MPLBACKEND=Agg
- secure: JPEQfViEt1HJ4G1jAahCf1epqwvFqiH2VMNJkLmf/KGBouWQVM/dUXKAybueRFK8MFgblx1WXFo9usJDxugF4Gok4FVKd3h7qRfREVfJwmZ/Cul3z9Lq61cIpSicPsaRWKB8jks1B+oGolWnY0C4Mq6vNewcWmZ/5OTfqEGt+6qMVFBFep2iHnNn556v4YKvjeVoYhl4nZIYXXnQ7TpWRAL2tLvxe65VEn9EOfgpDmpnTKbKeBtWE2yxFKruTGB194CbHnDaw1Rkp90No6KFqzq5l5kksAvtS7YYjoPRlPP8PzUcprymPwakANQ5kSr66fkaWCXApbVU8VUE+MPDR0YKtVmw0TJWKipCzkQOtginE/ZAcD326VHKPho+nRBfWGwxr4rnc303dSmwYKL1x+sowCaMuS74cARPhQRMxQDT2FpBglKazjeqX4euvG/IMGc7YQVdSDkxnNGO5+1GsAVN4Xfd/3tI2NgvMg0FVdD3rKJLEWb912wTwl4mm2dm2mMU3YvYrFVRvNtNZPNNJGlVtf93pNKxyyCDdFDfs4kh2tbrVfSin3Ku5s/qxtcjGeYGbEETbUUoBlQSemYiNrgbv+fn+snr+x7q1kV49vE+C5pxjtaaAnCp+oxWuzpXGwDvwthIT/3U6P5R6HE8l49FABGHOeX8PJcC2TJ8ZcI=
sudo: false
filter_secrets: false
jobs:
include:
- stage: lint
os: linux
script:
- pip install flake8
- make lint
- stage: docs
os: linux
install:
- conda env create --file docs/environment.yml
- conda activate terrainbento_docs
- pip install -e .
script:
- make -C docs clean html

- &deploy
stage: deploy
if: tag =~ v.*$
os: osx
env: CONDA_ENV=3.7
script:
- pip install twine wheel
- python setup.py bdist_wheel
- twine upload -u katybarnhart -p$TWINE_PASSWORD --verbose dist/*terrainbento*

before_install:
- |
if [[ $TRAVIS_OS_NAME == "osx" ]]; then
Expand All @@ -19,60 +44,25 @@ before_install:
rm -rf $(brew --cache)
fi
- |
if [[ "$TRAVIS_PYTHON_VERSION" == "3.7" && "$TRAVIS_OS_NAME" == "linux" && "$TRAVIS_EVENT_TYPE" == "push" ]]; then
REPORT_TO_COVERALLS=1
fi
- |
if [[ "$TRAVIS_PYTHON_VERSION" == "3.7" && "$TRAVIS_OS_NAME" == "linux" ]]; then
BUILD_DOCS=1
fi
install:
- echo "Build on $TRAVIS_OS_NAME for Python $TRAVIS_PYTHON_VERSION, $TRAVIS_TAG"
mkdir -p $HOME/.matplotlib
echo "backend: Agg" > $HOME/.matplotlib/matplotlibrc
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
OS="MacOSX-x86_64"
curl https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh > $HOME/miniconda.sh
else
OS="Linux-x86_64"
curl https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh > $HOME/miniconda.sh
fi
- curl $MINICONDA_URL_BASE-$OS.sh > $HOME/minconda.sh
- bash $HOME/minconda.sh -b -p $CONDA_PREFIX
- export PATH="$CONDA_PREFIX/bin:$PATH"
- bash $HOME/miniconda.sh -b -p $(pwd)/anaconda
- export PATH="$(pwd)/anaconda/bin:$PATH"
- hash -r
- conda info
- conda config --set always_yes yes --set changeps1 no
- conda update conda
- conda config --add channels conda-forge
# Useful for debugging any issues with conda
- conda create -n test-environment python=$TRAVIS_PYTHON_VERSION
- source activate test-environment
- conda install -q curl
- conda install -q libcurl
- conda install -q coverage
- conda install -q coveralls
- conda install -q sphinx
- conda install -q pytest
- conda install -q pytest-cov
- conda install -q flake8
- pip install --upgrade pip
- pip install codacy-coverage
- conda create -n test_env python=$CONDA_ENV
- source activate test_env
- conda info -a && conda list
- conda install --file=requirements.txt
- python setup.py install

install:
- pip install numpy
- pip install -e .
script:
- pytest --cov --cov-report=xml:$(pwd)/coverage.xml
- |
if [[ "$REPORT_TO_COVERALLS" == "1" ]]; then
coveralls
export CODACY_PROJECT_TOKEN=$CODACITY_API_TOKEN
python-codacy-coverage -r coverage.xml
fi
- make lint
- |
if [[ "$BUILD_DOCS" == "1" && "$TRAVIS_OS_NAME" == "linux" ]]; then
(cd docs && make html)
fi
virtualenv:
system_site_packages: false
- pip install pytest pytest-cov pytest-datadir coveralls
- pytest --cov-report=xml:$(pwd)/coverage.xml
after_success: coveralls
76 changes: 48 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
| CI Status | Coverage | Docs | License | Health | Style | DOI |
| --- | --- | --- | --- | --- | --- | --- |
| [![Build Status](https://travis-ci.org/TerrainBento/terrainbento.svg?branch=master)](https://travis-ci.org/TerrainBento/terrainbento) [![Build status](https://ci.appveyor.com/api/projects/status/kwwpjifg8vrwe51x/branch/master?svg=true)](https://ci.appveyor.com/project/kbarnhart/terrainbento/branch/master) | [![Coverage Status](https://coveralls.io/repos/github/TerrainBento/terrainbento/badge.svg?branch=master)](https://coveralls.io/github/TerrainBento/terrainbento?branch=master) | [![Documentation Status](https://readthedocs.org/projects/terrainbento/badge/?version=latest)](http://terrainbento.readthedocs.io/en/latest/?badge=latest) | [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) |[![Code Health](https://landscape.io/github/TerrainBento/terrainbento/master/landscape.svg?style=flat)](https://landscape.io/github/TerrainBento/terrainbento/master) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/7fcb775a6c3044cda4429ed1c1dac2e8)](https://www.codacy.com/app/katy.barnhart/terrainbento?utm_source=github.com&utm_medium=referral&utm_content=TerrainBento/terrainbento&utm_campaign=Badge_Grade)| [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)| [![DOI](https://zenodo.org/badge/123941145.svg)](https://zenodo.org/badge/latestdoi/123941145)|

| Name | Downloads | Version | Platforms |
| --- | --- | --- | --- |
| [![Conda Recipe](https://img.shields.io/badge/recipe-terrainbento-green.svg)](https://anaconda.org/conda-forge/terrainbento) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/terrainbento.svg)](https://anaconda.org/conda-forge/terrainbento) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/terrainbento.svg)](https://anaconda.org/conda-forge/terrainbento) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/terrainbento.svg)](https://anaconda.org/conda-forge/terrainbento) |
| Thing | Badge |
| :---: | :---: |
| CI Status | [![Build Status](https://travis-ci.org/TerrainBento/terrainbento.svg?branch=master)](https://travis-ci.org/TerrainBento/terrainbento) [![Build status](https://ci.appveyor.com/api/projects/status/kwwpjifg8vrwe51x/branch/master?svg=true)](https://ci.appveyor.com/project/kbarnhart/terrainbento/branch/master) |
| Coverage | [![Coverage Status](https://coveralls.io/repos/github/TerrainBento/terrainbento/badge.svg?branch=master)](https://coveralls.io/github/TerrainBento/terrainbento?branch=master) |
| Docs | [![Documentation Status](https://readthedocs.org/projects/terrainbento/badge/?version=latest)](http://terrainbento.readthedocs.io/en/latest/?badge=latest) |
| License | [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) |
| Health | [![Code Health](https://landscape.io/github/TerrainBento/terrainbento/master/landscape.svg?style=flat)](https://landscape.io/github/TerrainBento/terrainbento/master) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/7fcb775a6c3044cda4429ed1c1dac2e8)](https://www.codacy.com/app/katy.barnhart/terrainbento?utm_source=github.com&utm_medium=referral&utm_content=TerrainBento/terrainbento&utm_campaign=Badge_Grade) |
| Style | [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black) |
| DOI | [![DOI](https://zenodo.org/badge/123941145.svg)](https://zenodo.org/badge/latestdoi/123941145) |
| Conda Recipe | [![Conda Recipe](https://img.shields.io/badge/recipe-terrainbento-green.svg)](https://anaconda.org/conda-forge/terrainbento) |
| Downloads | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/terrainbento.svg)](https://anaconda.org/conda-forge/terrainbento) |
| Version | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/terrainbento.svg)](https://anaconda.org/conda-forge/terrainbento) |
| Platforms | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/terrainbento.svg)](https://anaconda.org/conda-forge/terrainbento) |
| Binder | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/TerrainBento/terrainbento/master?filepath=notebooks%2FWelcome_to_TerrainBento.ipynb) |

# terrainbento

A modular landscape evolution modeling package built on top of the [Landlab Toolkit](http://landlab.github.io).

terrainbento"s User Manual is located at our [Read The Docs page](http://terrainbento.readthedocs.io/).

We recommend that you start with [this set of Jupyter notebooks](https://github.com/TerrainBento/examples_tests_and_tutorials) that introduce terrainbento .
We recommend that you start with a set of Jupyter notebooks [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/TerrainBento/terrainbento/master?filepath=notebooks%2FWelcome_to_TerrainBento.ipynb) that introduce terrainbento and the model description paper [Barnhart et al. (2019)](https://doi.org/10.5194/gmd-12-1267-2019). The link above goes to a Binder instance, if you want the notebooks themselves clone the repo and navigate to the directory `notebooks`.

A manuscript describing terrainbento is currently in discussion at GMD. The discussion paper can be found [here](https://www.geosci-model-dev-discuss.net/gmd-2018-204/).

## A quick example

Expand All @@ -32,9 +38,26 @@ params = {
"step": 10,
"stop": 1e5},

# Create the Grid.
"grid": {"grid": {"RasterModelGrid":[(200, 320), {"xy_spacing": 10}]},
"fields": {"at_node": {"topographic__elevation":{"random":[{"where":"CORE_NODE"}]}}}},
# Create the Grid
"grid": {
"RasterModelGrid": [
(200, 320),
{
"xy_spacing": 10
},
{
"fields": {
"node": {
"topographic__elevation": {
"random": [{
"where": "CORE_NODE"
}]
}
}
}
},
]
},

# Set up Boundary Handlers
"boundary_handlers":{"NotCoreNodeBaselevelHandler": {"modify_core_nodes": True,
Expand Down Expand Up @@ -88,37 +111,34 @@ with imageio.get_writer("terrainbento_example.gif", mode="I") as writer:

Before installing terrainbento you will need a python distribution. We recommend that you use the [Anaconda python distribution](https://www.anaconda.com/download/). Unless you have a specific reason to want Python 2.7 we strongly suggest that you install Python 3.7 (or the current 3.* version provided by Anaconda).

To install the release version of terrainbento (this is probably what you want) we support conda and pip package management.

### Using conda
To install the release version of terrainbento (this is probably what you want) open a terminal and execute the following:
Open a terminal and execute the following:

```
conda config --add channels conda-forge
conda install terrainbento
```

### From source code

To install the terrainbento source code version of terrainbento do the following:

#### Option A: You already have landlab installed (either through conda or through the source code)
### Using pip
Open a terminal and execute the following:

```
git clone https://github.com/TerrainBento/terrainbento.git
cd terrainbento
conda install --file=requirements.txt
python setup.py install
pip install terrainbento
```

#### Option B: You do not have landlab installed
### From source code

To install the terrainbento source code version of terrainbento we recommend creating a conda environment for terrainbento.

```
conda config --add channels conda-forge
conda install landlab
git clone https://github.com/TerrainBento/terrainbento.git
cd terrainbento
conda install --file=requirements.txt
cconda env create -f environment-dev.yml
conda activate terrainbento-dev
python setup.py install
```
```

#### A note to developers

Expand All @@ -127,4 +147,4 @@ If you plan to develop with terrainbento, please fork terrainbento, clone the fo

## How to cite

A manuscript describing terrainbento is currently in discussion at GMD. The discussion paper can be found [here](https://www.geosci-model-dev-discuss.net/gmd-2018-204/).
Barnhart, K. R., Glade, R. C., Shobe, C. M., and Tucker, G. E.: Terrainbento 1.0: a Python package for multi-model analysis in long-term drainage basin evolution, Geosci. Model Dev., 12, 1267-1297, https://doi.org/10.5194/gmd-12-1267-2019, 2019.
36 changes: 18 additions & 18 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
environment:

TWINE_PASSWORD:
secure: 7/AZVv0ovctfsb6fBFuC84eyDbvrPSwFlwtIR5RKvQ0=
matrix:

- TARGET_ARCH: x64
CONDA_PY: 27
CONDA_INSTALL_LOCN: C:\\Miniconda-x64
DISTUTILS_USE_SDK: 1
CONDA_NPY: 111
CONDA_INSTALL_LOCN: C:\\Miniconda37-x64
CONDA_PY: 3.7

- TARGET_ARCH: x64
CONDA_NPY: 111
CONDA_INSTALL_LOCN: C:\\Miniconda36-x64
CONDA_PY: 36

- TARGET_ARCH: x64
CONDA_INSTALL_LOCN: C:\\Miniconda37-x64
CONDA_PY: 37
CONDA_PY: 3.6

platform:
- x64
Expand All @@ -27,18 +25,20 @@ init:

install:
- cmd: call %CONDA_INSTALL_LOCN%\Scripts\activate.bat
- cmd: conda config --set always_yes yes
- cmd: conda update conda
- cmd: conda update --yes --quiet conda
- cmd: set PYTHONUNBUFFERED=1
- cmd: conda config --set always_yes yes
- cmd: pip install twine pytest pytest-cov pytest-datadir
- cmd: conda info
- cmd: conda config --add channels conda-forge
- cmd: pip install pytest
- cmd: conda config --set always_yes yes --set changeps1 no
- cmd: conda info -a && conda list
- cmd: conda install --file=requirements.txt
- cmd: python setup.py install
- cmd: conda list

build: false

test_script:
- cmd: pytest
- pip install numpy"
- pip install -e ."
- pytest -vvv

artifacts:
# Archive the generated conda package in the ci.appveyor.com build report.
- path: 'dist\*'
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SPHINXAPIDOC = sphinx-apidoc
SPHINXPROJ = terrainbento
SOURCEDIR = .
BUILDDIR = _build
SPHINXEXCLUDE = $(shell find ../terrainbento/* -name tests -or -name examples)
SPHINXEXCLUDE = $(shell find ../terrainbento/* -name tests)


# Put it first so that "make" without argument is like "make help".
Expand Down
9 changes: 0 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,6 @@ def test():
"yaml",
"numpy",
"numpy.testing",
"nose",
"nose.plugins",
"nose.plugins.base",
"doctests",
"Doctest",
"Tester",
"doctests.Doctest",
"test",
"bench",
"xarray",
"dask",
"glob",
Expand Down
15 changes: 15 additions & 0 deletions docs/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

name: terrainbento_docs
channels:
- conda-forge
dependencies:
- python==3.6
- numpy
- pandoc
- pip
- sphinx>=1.5.1
- sphinx_rtd_theme
- tornado
- entrypoints
- pip:
- sphinxcontrib_github_alt
19 changes: 19 additions & 0 deletions environment-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: terrainbento-dev
channels:
- conda-forge
dependencies:
- python
- black
- flake8
- isort
- pytest
- pytest-cov
- scipy
- numpy
- xarray
- dask
- landlab>=1.9
- jupyter
- holoviews
- pandas
- dask[complete]
Loading

0 comments on commit 2b2ad53

Please sign in to comment.