Skip to content

Commit 6d2d4af

Browse files
committed
clean up dependencies
1 parent 3c48dda commit 6d2d4af

File tree

10 files changed

+23
-14
lines changed

10 files changed

+23
-14
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ before_install:
1919
- conda install nomkl
2020

2121
install:
22-
- conda create --channel=conda-forge --name testenv --yes python=$TRAVIS_PYTHON_VERSION pandas engarde
22+
- conda create --channel=conda-forge --name testenv --yes python=$TRAVIS_PYTHON_VERSION pandas
2323
- source activate testenv
2424
- conda install --channel=conda-forge --yes pytest coverage pytest-mpl pytest-cov pytest-pep8
2525
- pip install git+https://github.com/tomp/python-metar.git

README.rst

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ Dependencies
4444
------------
4545
* Python 3.5 or greater
4646
* recent versions of pandas, matplotlib
47-
* requests for hitting the NOAA web API
4847
* python-metar to actually parse the metar codes
4948
* Jupyter for running notebook-based examples (optional)
5049
* pytest for testing (optional)

cloudside/asos.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import numpy
88
import pandas
9-
import engarde.checks as ec
109

1110
from . station import MetarParser
1211
from . import validate
@@ -200,7 +199,7 @@ def parse_file(filepath, new_precipcol='precipitation'):
200199

201200
rt = _find_reset_time(data['raw_precipitation'])
202201
precip = _process_precip(data, rt, 'raw_precipitation')
203-
return data.assign(**{new_precipcol: precip}).pipe(ec.unique_index)
202+
return data.assign(**{new_precipcol: precip})
204203

205204

206205
def get_data(station_id, startdate, stopdate, email, folder='.',
@@ -247,4 +246,5 @@ def get_data(station_id, startdate, stopdate, email, folder='.',
247246
raw_folder=_raw_folder, pbar_fxn=pbar_fxn,
248247
force_download=force_download)
249248
raw_files = validate.progress_bar(pbar_fxn, _raw_files, desc='Parsing')
250-
return pandas.concat([parse_file(rf) for rf in raw_files]).pipe(ec.unique_index)
249+
df = pandas.concat([parse_file(rf) for rf in raw_files])
250+
return df.pipe(validate.unique_index)

cloudside/tests/test_asos.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def test_parse_file():
105105

106106

107107
@mock.patch('ftplib.FTP')
108-
@mock.patch('engarde.checks.unique_index')
108+
@mock.patch('cloudside.validate.unique_index')
109109
@mock.patch('cloudside.asos._fetch_file')
110110
@mock.patch('cloudside.asos.parse_file', return_value=pandas.Series([1, 2, 3]))
111111
def test_get_data(parser, fetcher, checker, ftp):

cloudside/tests/test_validate.py

+10
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,13 @@ def test_step(step, error):
6464
def test_file_status(filename, expected):
6565
fn = getTestFile(filename)
6666
validate.file_status(fn) == expected
67+
68+
69+
@pytest.mark.parametrize(('index', 'error'), [
70+
(list('ABCD'), None),
71+
(list('AABC'), ValueError)
72+
])
73+
def unique_index(index, error):
74+
x = pandas.Series(range(4), index=index)
75+
with raises(error):
76+
pdtest.assert_series_equal(x, validate.unique_index(x))

cloudside/validate.py

+7
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,10 @@ def progress_bar(pbar_fxn, sequence, **kwargs):
6060
else:
6161
pbar = pbar_fxn(sequence, **kwargs)
6262
return pbar
63+
64+
65+
def unique_index(df):
66+
if df.index.is_unique:
67+
return df
68+
else:
69+
raise ValueError('index is not unique')

conda.recipe/dev/meta.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,12 @@ requirements:
2020
- metar
2121
- matplotlib
2222
- pandas
23-
- requests
24-
2523

2624
run:
2725
- python
2826
- metar
2927
- matplotlib
3028
- pandas
31-
- requests
3229

3330
test:
3431
imports:

conda.recipe/stable/meta.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,12 @@ requirements:
2121
- metar
2222
- matplotlib
2323
- pandas
24-
- requests
25-
2624

2725
run:
2826
- python
2927
- metar
3028
- matplotlib
3129
- pandas
32-
- requests
3330

3431
test:
3532
imports:

requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
numpy
22
matplotlib
33
pandas
4-
engarde
54
metar >= 1.5

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
download_url="http://sourceforge.net/project/platformdownload.php?group_id=134052",
2424
license="BSD 3-Clause",
2525
packages=find_packages(exclude=[]),
26-
platforms="Python 3.4 and later.",
26+
platforms="Python 3.6 and later.",
2727
classifiers=[
2828
"Development Status :: 3 - Alpha",
2929
"Environment :: Console",

0 commit comments

Comments
 (0)