Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the BADGES.rst and to docsrc/*.rst and read into README.rst. Added test_extract.py test.
- Loading branch information
Showing
8 changed files
with
142 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.. image:: https://travis-ci.org/timcera/hspfbintoolbox.svg?branch=master | ||
:target: https://travis-ci.org/timcera/hspfbintoolbox | ||
:height: 20 | ||
|
||
.. image:: https://coveralls.io/repos/timcera/hspfbintoolbox/badge.png?branch=master | ||
:target: https://coveralls.io/r/timcera/hspfbintoolbox?branch=master | ||
:height: 20 | ||
|
||
.. image:: https://pypip.in/v/hspfbintoolbox/badge.png?style=flat | ||
:alt: Latest release | ||
:target: https://pypi.python.org/pypi/hspfbintoolbox | ||
|
||
.. image:: https://pypip.in/d/hspfbintoolbox/badge.png?style=flat | ||
:alt: PyPI downloads count | ||
:target: https://pypi.python.org/pypi/hspfbintoolbox | ||
|
||
.. image:: https://pypip.in/license/hspfbintoolbox/badge.png?style=flat | ||
:alt: hspfbintoolbox license | ||
:target: https://pypi.python.org/pypi/hspfbintoolbox/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.3.3 | ||
0.3.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.. include:: ../BADGES.rst | ||
.. include:: ../AUTHORS.rst | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.. include:: ../BADGES.rst | ||
.. include:: ../CONTRIBUTING.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. include:: ../BADGES.rst | ||
|
||
Documentation for hspfbintoolbox | ||
================================ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.. include:: ../BADGES.rst | ||
License | ||
======= | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
catalog | ||
---------------------------------- | ||
Tests for `hspfbintoolbox` module. | ||
""" | ||
|
||
import shlex | ||
import subprocess | ||
from pandas.util.testing import TestCase | ||
from pandas.util.testing import assert_frame_equal | ||
import sys | ||
try: | ||
from cStringIO import StringIO | ||
except: | ||
from io import StringIO | ||
|
||
import pandas as pd | ||
from hspfbintoolbox import hspfbintoolbox | ||
|
||
def capture(func ,*args, **kwds): | ||
sys.stdout = StringIO() # capture output | ||
out = func(*args ,**kwds) | ||
out = sys.stdout.getvalue() # release output | ||
try: | ||
out = bytes(out ,'utf-8') | ||
except: | ||
pass | ||
return out | ||
|
||
|
||
class TestDescribe(TestCase): | ||
def setUp(self): | ||
self.extract = b'''Datetime,PERLND_905_AGWS_5 | ||
1950-01-01,0.844675 | ||
1951-01-01,1.0192 | ||
1952-01-01,0.267736 | ||
1953-01-01,1.19279 | ||
1954-01-01,1.33441 | ||
1955-01-01,0.00773311 | ||
1956-01-01,0.0935213 | ||
1957-01-01,1.09429 | ||
1958-01-01,0.223077 | ||
1959-01-01,1.53743 | ||
1960-01-01,0.860453 | ||
1961-01-01,0 | ||
1962-01-01,0.780285 | ||
1963-01-01,1.00642 | ||
1964-01-01,0.4788 | ||
1965-01-01,1.35207 | ||
1966-01-01,1.3705 | ||
1967-01-01,1.09639 | ||
1968-01-01,1.29344 | ||
1969-01-01,1.93707 | ||
1970-01-01,0.0277334 | ||
1971-01-01,1.26292 | ||
1972-01-01,0.967934 | ||
1973-01-01,1.25762 | ||
1974-01-01,1.16271 | ||
1975-01-01,1.32554 | ||
1976-01-01,1.25165 | ||
1977-01-01,1.77333 | ||
1978-01-01,1.58396 | ||
1979-01-01,1.16706 | ||
1980-01-01,0.109924 | ||
1981-01-01,0.237772 | ||
1982-01-01,1.31026 | ||
1983-01-01,1.86002 | ||
1984-01-01,0.881553 | ||
1985-01-01,0.494373 | ||
1986-01-01,1.23408 | ||
1987-01-01,0.773598 | ||
1988-01-01,0 | ||
1989-01-01,1.01879 | ||
1990-01-01,0.471807 | ||
1991-01-01,0.811257 | ||
1992-01-01,1.46362 | ||
1993-01-01,0.580862 | ||
1994-01-01,1.62932 | ||
1995-01-01,1.29516 | ||
1996-01-01,1.3109 | ||
1997-01-01,1.67992 | ||
1998-01-01,1.30317 | ||
1999-01-01,1.40244 | ||
2000-01-01,0.0191165 | ||
''' | ||
|
||
def test_extract_cli(self): | ||
args = 'hspfbintoolbox extract tests/6b_np1.hbn yearly ,905,,AGWS' | ||
args = shlex.split(args) | ||
out = subprocess.Popen(args ,stdout=subprocess.PIPE, stdin=subprocess.PIPE).communicate()[0] | ||
self.assertEqual(out, self.extract) |