Skip to content

Commit c3c957e

Browse files
author
Joe Hamman
committed
Merge pull request #21 from UW-Hydro/develop
merge develop into master for tonic 0.1
2 parents e608d64 + 6e61d48 commit c3c957e

25 files changed

+739
-479
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ data/
44
modelforcings/
55
modeloutput/
66
plots/
7+
build/
8+
dist/
79
#file types to ignore
810
*junk*
911
*tmp*

.travis.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,39 @@
1+
sudo: false # travis container-based infrastructure
2+
13
language: python
24

35
python:
4-
- "2.6"
56
- "2.7"
6-
- "3.3"
7+
- "3.4"
8+
9+
# Setup anaconda
10+
before_install:
11+
- wget http://repo.continuum.io/miniconda/Miniconda-2.2.2-Linux-x86_64.sh -O miniconda.sh
12+
- chmod +x miniconda.sh
13+
- ./miniconda.sh -b
14+
- export PATH=/home/travis/anaconda/bin:$PATH
15+
# Update conda itself
16+
- conda update --yes conda
717

818
install:
19+
- conda create --yes --name=tonic_test_env python=$TRAVIS_PYTHON_VERSION --file=ci/requirements-$TRAVIS_PYTHON_VERSION.txt
20+
- source activate tonic_test_env
921
- python setup.py install
1022

1123
# command to run tests
1224
script:
25+
- which python
26+
- python --version
27+
- conda list
28+
- pip freeze
29+
- echo $PATH
1330
- vic_utils -h
31+
- py.test
32+
33+
notifications:
34+
webhooks:
35+
urls:
36+
- https://webhooks.gitter.im/e/0b751ac59ea833728a02
37+
on_success: change # options: [always|never|change] default: always
38+
on_failure: always # options: [always|never|change] default: always
39+
on_start: false # default: false

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
TONIC
22
=====
33

4+
[![Build Status](https://travis-ci.org/UW-Hydro/tonic.svg?branch=develop)](https://travis-ci.org/UW-Hydro/tonic)
5+
46
`tonic` is a toolkit for working with distributed hydrologic models and their output.
57

6-
This is truely a work in progress...
8+
This is truly a work in progress...
79

810
## Models:
9-
1. [the Vairable Infiltration Capacity (VIC) model](https://github.com/UW-Hydro/VIC)
10-
1. [the Community Land Model (CLM)](http://www.cgd.ucar.edu/tss/clm/)
11-
1. [the Unified Land Model (ULM)](https://github.com/UW-Hydro/ULM)
12-
1. [the Precipitation Runoff Modeling System (PRMS)](http://wwwbrr.cr.usgs.gov/projects/SW_MoWS/PRMS.html)
13-
1. [the Noah Land Surface Model](http://www.ral.ucar.edu/research/land/technology/lsm.php)
14-
1. [the Structure for Unifying Multiple Modeling Alternatives (SUMMA)](http://www.ral.ucar.edu/projects/summa/)
11+
1. [Variable Infiltration Capacity (VIC) model](https://github.com/UW-Hydro/VIC)
12+
1. [Community Land Model (CLM)](http://www.cgd.ucar.edu/tss/clm/)
13+
1. [Unified Land Model (ULM)](https://github.com/UW-Hydro/ULM)
14+
1. [Precipitation Runoff Modeling System (PRMS)](http://wwwbrr.cr.usgs.gov/projects/SW_MoWS/PRMS.html)
15+
1. [Noah Land Surface Model](http://www.ral.ucar.edu/research/land/technology/lsm.php)
16+
1. [Structure for Unifying Multiple Modeling Alternatives (SUMMA)](http://www.ral.ucar.edu/projects/summa/)
17+
1. [FLO-2D hydrodynamic floodplain model](http://www.flo-2d.com/)
18+
1. [SNOW17 accumulation and ablation model](http://www.nws.noaa.gov/oh/hrl/nwsrfs/users_manual/part2/_pdf/22snow17.pdf)
1519

1620
## Scripts:
1721
`tonic` currently has 1 script available for use on the command line.
1822

19-
**vic_utils**: is a utility script that runs a number of VIC related processing tools. Once `tonic` is installed, `vic_utils` will be available in your path. Run `vic_utils -h` for a description of the utilities available.
23+
**vic_utils**: a utility script that runs a number of VIC related processing tools. Once `tonic` is installed, `vic_utils` will be available in your path. Run `vic_utils -h` for a description of the utilities available.
2024

2125
## Install:
2226
Dependencies:
23-
- python 3
27+
- python 2.7 or greater
2428
- netCDF4
2529
- xray
2630
- matplotlib
@@ -29,5 +33,4 @@ Dependencies:
2933

3034
To install `tonic`, run `python setup.py install` from this directory.
3135

32-
Questions? Sure, Joe Hamman - jhamman at hydro.washington.edu
33-
36+
Questions? Find us on [![Join the chat at https://gitter.im/UW-Hydro/tonic](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/UW-Hydro/tonic?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge).

ci/requirements-2.7.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
matplotlib
2+
netCDF4
3+
numpy
4+
scipy
5+
pandas
6+
pytest
7+
xray
8+
configobj
9+
basemap

ci/requirements-3.4.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
matplotlib
2+
netCDF4
3+
numpy
4+
scipy
5+
pandas
6+
pytest
7+
xray
8+
configobj
9+
basemap

forcing_tools/netcdf2vic.py

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

setup.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
import re
44
import sys
55
import warnings
6-
try:
7-
from setuptools import setup
8-
except:
9-
from distutils.core import setup
6+
from setuptools import setup, find_packages
107

118
MAJOR = 0
129
MINOR = 0
@@ -94,10 +91,10 @@ def write_version_py(filename=None):
9491
# Run Setup
9592
setup(name='tonic',
9693
version=FULLVERSION,
97-
description='tonic is a Python toolkit for distributed hydrologic modeling',
94+
description='tonic is a Python toolkit for distributed hydrologic models',
9895
author='Joe Hamman',
9996
author_email='[email protected]',
10097
url='https://github.com/jhamman/tonic',
101-
packages=['tonic', 'tonic.models', 'tonic.data_tools'],
98+
packages=find_packages(),
10299
scripts=['scripts/vic_utils'])
103100
# -------------------------------------------------------------------- #

tests/test_pycompat.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from tonic.pycompat import pyrange, pyzip, iteritems
2+
3+
4+
def test_pyrange():
5+
x = pyrange(5)
6+
assert list(x) == [0, 1, 2, 3, 4]
7+
8+
9+
def test_pyzip():
10+
a = [1, 2, 3]
11+
b = ['a', 'b', 'c']
12+
13+
z = pyzip(a, b)
14+
assert hasattr(z, '__iter__')
15+
lz = list(pyzip(a, b))
16+
assert lz[0] == (1, 'a')
17+
assert len(lz) == len(a) # == len(b)
18+
19+
20+
def test_iteritems():
21+
d = {'a': 0, 'b': 1, 'c': 2}
22+
for k, v in iteritems(d):
23+
assert type(k) == str
24+
assert type(v) == int

0 commit comments

Comments
 (0)