Skip to content

Commit 7e56364

Browse files
authored
Add CI testing for notebooks.
Merge pull request #10 from landlab/mcflugen/test-notebooks
2 parents dcba533 + 9051417 commit 7e56364

46 files changed

Lines changed: 745 additions & 9094 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ci/header.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

.ci/notebook_to_script.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

.ci/run_tutorials.py

Lines changed: 0 additions & 66 deletions
This file was deleted.

.ci/travis/install_python.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
.DS_Store
33

44
*.out
5-
*.png
65
*.pyc

.travis.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,43 @@
11
env:
22
matrix:
33
- TRAVIS_PYTHON_VERSION="2.7"
4-
- TRAVIS_PYTHON_VERSION="3.4"
54
- TRAVIS_PYTHON_VERSION="3.5"
5+
- TRAVIS_PYTHON_VERSION="3.6"
6+
global:
7+
- CONDA_PREFIX=$HOME/miniconda
8+
- MINICONDA_URL_BASE="https://repo.continuum.io/miniconda/Miniconda3-latest"
9+
- MPLCONFIGDIR=$HOME/.config/matplotlib
610
os:
711
- linux
812
- osx
913
sudo: false
14+
before_install:
15+
- |
16+
if [[ $TRAVIS_OS_NAME == "osx" ]]; then
17+
brew remove --force $(brew list)
18+
brew cleanup -s
19+
rm -rf $(brew --cache)
20+
fi
1021
install:
1122
- echo "Build on $TRAVIS_OS_NAME for Python $TRAVIS_PYTHON_VERSION"
12-
- bash .ci/travis/install_python.sh
13-
- export PATH="$HOME/miniconda/bin:$PATH"
14-
- conda install -q -c https://conda.anaconda.org/landlab/label/dev landlab
23+
- |
24+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
25+
OS="MacOSX-x86_64"
26+
else
27+
OS="Linux-x86_64"
28+
fi
29+
- curl $MINICONDA_URL_BASE-$OS.sh > $HOME/minconda.sh
30+
- bash $HOME/minconda.sh -b -p $CONDA_PREFIX
31+
- export PATH="$CONDA_PREFIX/bin:$PATH"
32+
- hash -r
33+
- conda config --set always_yes yes --set changeps1 no
34+
- conda install python=$TRAVIS_PYTHON_VERSION
35+
- conda install scripting -c csdms-stack
36+
- conda install landlab jupyter -c landlab
37+
- conda info -a && conda list
1538
script:
16-
- python .ci/run_tutorials.py
39+
- mkdir -p $MPLCONFIGDIR
40+
- "echo backend: Agg > $MPLCONFIGDIR/matplotlibrc"
41+
- ./run-all-tests.sh
1742
virtualenv:
1843
system_site_packages: false

CONTRIBUTING.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Contributing to landlab tutorials
2+
3+
Thank you for contributing to the landlab tutorials! We appreciate
4+
your help as this is largely as volunteer effort! :heart: :heart: :heart:
5+
6+
# How to contribute
7+
8+
## Reporting Bugs
9+
10+
Before creating a bug report, please do at least a cursory check that the
11+
bug has not already been reported. If it has, add a comment to the existing
12+
issue instead of opening a new one.
13+
14+
### Submitting a Bug Report
15+
16+
Bugs are tracked as
17+
[GitHub issues](https://guides.github.com/features/issues/). After you've
18+
determined you've found a new bug, please open a
19+
[new issue](https://github.com/landlab/tutorials/issues).
20+
21+
Explain the problem and include additional details to help maintainers
22+
reproduce the problem. Here are some items that will make it easier
23+
to track down the source of the problem.
24+
25+
* **Use a clear and descriptive title** for the issue that identifies the
26+
problem.
27+
* **Describe the exact steps that reproduce the problem**.
28+
* **If possible, provide an example that demonstrates the step** as,
29+
for example, a bash script along with input files.
30+
* **Describe the behavior you are seeing after these steps**.
31+
* **Describe the behavior you expect to see after these steps**.
32+
33+
Additionally, the answers to the following questions about your run
34+
environment will be helpful.
35+
36+
* **Which version of landlab are you using?** This could be a specific
37+
git sha or a release number.
38+
* **What is he name and version of you OS?**
39+
* **What compiler are you using?**
40+
* **How did you build landlab (if using the development version)?**
41+
42+
43+
## Submitting Changes
44+
45+
:tada: Whoa! This is great! We love it when folks contibute code! :tada:
46+
47+
Changes to landlab tutorials should be submitted as
48+
[pull requests](http://help.github.com/pull-requests/)).
49+
50+
* Create a GitHub issue that describes what you propose to do.
51+
* Create a topic branch that contains your changes.
52+
* Open a new [GitHub pull request](https://github.com/landlab/tutorials/pull/new/master).
53+
* Ensure the PR description clearly describes the problem and solution.
54+
Include the relevant issue number.
55+
56+
## Styleguides
57+
58+
Use the [PEP8 style guide](https://www.python.org/dev/peps/pep-0008/).
59+
You may want to use tools like
60+
[Prospector](http://prospector.landscape.io/en/master/) to help out
61+
with this.
62+
63+
### Git Commit Messages
64+
65+
* Use the present tense ("Add feature" not "Added feature")
66+
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
67+
* Limit the first line to 72 characters or less
68+
* Reference issues and pull requests liberally
69+
* Consider starting the commit message with an applicable emoji:
70+
* :art: `:art:` when improving the format/structure of the code
71+
* :racehorse: `:racehorse:` when improving performance
72+
* :non-potable_water: `:non-potable_water:` when plugging memory leaks
73+
* :memo: `:memo:` when writing docs
74+
* :penguin: `:penguin:` when fixing something on Linux
75+
* :apple: `:apple:` when fixing something on macOS
76+
* :checkered_flag: `:checkered_flag:` when fixing something on Windows
77+
* :bug: `:bug:` when fixing a bug
78+
* :fire: `:fire:` when removing code or files
79+
* :green_heart: `:green_heart:` when fixing the CI build
80+
* :white_check_mark: `:white_check_mark:` when adding tests
81+
* :shirt: `:shirt:` when removing linter warnings
82+
83+
## Adding new tutorials
84+
85+
If you would like to create a new tutorial that we have just a few
86+
conventions that we would like you to follow.
87+
88+
* Create a new folder that will hold your tutorial notebook
89+
and data used by your tutorial.
90+
* Start with the blank tutorial template provided in this repository.
91+
* Notice that your first cell of code should import `print_function`
92+
from `__future__`. Your tutorial will need to be compatible with
93+
both Python 2.7 and 3.4+.
94+
* If you will be plotting anything, be sure to use include ipython
95+
magic command in the first cell to indicate how plots should
96+
be rendered.
97+
* Your tutorial must be able to run without error for the **most
98+
recent landlab release**.
99+
100+
Thanks! :heart: :heart: :heart:
101+
102+
The landlab team

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[![Build
2+
Status](https://travis-ci.org/landlab/tutorials.svg?branch=master)](https://travis-ci.org/landlab/tutorials)
3+
14
[![Landlab header](./landlab_header.png)](http://landlab.github.io)
25

36
Most of these Landlab tutorials can either be read as text files or run as interactive IPython notebooks (recommended!).

boundary_conds/set_BCs_from_xy.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)