Skip to content

Commit d45d14b

Browse files
authored
0.2.2 (#24)
* increment version * added some tests (#22) * new traceback for missing nodes in rpt file. fixes #21. (#23) * cleanup requirements * cleanup requirements * cruft cleanup
1 parent eb90b4f commit d45d14b

11 files changed

+271
-376
lines changed

.travis.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,14 @@ before_install:
4343
- chmod +x miniconda.sh
4444
- ./miniconda.sh -b -p $HOME/miniconda
4545
- export PATH="$HOME/miniconda/bin:$PATH"
46-
- conda update --yes conda
47-
- conda install --yes nomkl
46+
- conda update --yes --quiet conda
4847

4948
# We just set up a conda environment with the right Python version.
5049
# This should not need changing.
5150
install:
52-
- conda create --yes -n test python=$TRAVIS_PYTHON_VERSION numpy pandas
51+
- conda create --yes --quiet -n test python=$TRAVIS_PYTHON_VERSION nomkl numpy pandas
5352
- source activate test
54-
- conda install --yes --channel=conda-forge ${TESTERS} ${NXVERSION}
53+
- conda install --yes --quiet --channel conda-forge ${TESTERS} ${NXVERSION}
5554
- pip install codecov pint==0.8.1
5655
- pip install git+https://github.com/lucashtnguyen/hymo.git
5756
- pip install .

environment.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ channels:
33
- conda-forge
44
- defaults
55
dependencies:
6-
- networkx=2.0=py35_0
7-
- numpy=1.13.1=py35_0
8-
- pandas=0.20.3=py35_0
9-
- python=3.5.4=0
10-
- pydotplus=2.0.2=py35_0
11-
- matplotlib=2.0.2=np113py35_0
12-
- pytest=3.2.1=py35_0
13-
- pytest-cov=2.3.1=py35_0
6+
- networkx=2.1
7+
- numpy
8+
- pandas
9+
- python=3.5
10+
- pydot=1.2
11+
- matplotlib=2.1
12+
- pytest=3.2
13+
- pip:
14+
- pint==0.8.1

requirements_dev.txt

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,2 @@
1-
pip==8.1.2
2-
bumpversion==0.5.3
3-
wheel==0.29.0
4-
watchdog==0.8.3
5-
flake8==2.6.0
6-
tox==2.3.1
7-
coverage==4.1
8-
Sphinx==1.4.8
9-
10-
pytest==2.9.2
11-
pytest-runner==2.11.1
1+
coverage
2+
pytest

setup.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,9 @@ def get_pkg_info(info_file, info):
6262
'Intended Audience :: Developers',
6363
'License :: OSI Approved :: BSD License',
6464
'Natural Language :: English',
65-
'Programming Language :: Python :: 2',
66-
'Programming Language :: Python :: 2.6',
67-
'Programming Language :: Python :: 2.7',
6865
'Programming Language :: Python :: 3',
69-
'Programming Language :: Python :: 3.3',
70-
'Programming Language :: Python :: 3.4',
7166
'Programming Language :: Python :: 3.5',
67+
'Programming Language :: Python :: 3.6',
7268
],
7369
test_suite='tests',
7470
tests_require=test_requirements,

swmmnetwork/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
__author__ = 'Austin Orr'
66
__email__ = '[email protected]'
7-
__version__ = '0.2.1'
7+
__version__ = '0.2.2'
88

99
from .swmmnetwork import SwmmNetwork
1010
from .convert import (

swmmnetwork/core.py

+13-12
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,19 @@ def _sum_edge_attr(G, node, attr, method='edges', filter_key=None, split_on='-',
5050

5151
includes = edges
5252
if include_filter_flags is not None:
53-
includes = [edge for edge in edges
54-
if any([i in str(edge[2][filter_key]).split(split_on)
55-
for i in include_filter_flags])]
53+
includes = [
54+
edge for edge in edges
55+
if any([
56+
i in str(edge[2][filter_key]).split(split_on)
57+
for i in include_filter_flags])]
5658

5759
excludes = []
5860
if exclude_filter_flags is not None:
59-
excludes = [edge for edge in edges
60-
if any([i in str(edge[2][filter_key]).split(split_on)
61-
for i in exclude_filter_flags])]
61+
excludes = [
62+
edge for edge in edges
63+
if any([
64+
i in str(edge[2][filter_key]).split(split_on)
65+
for i in exclude_filter_flags])]
6266

6367
edges = [i for i in includes if i not in excludes]
6468

@@ -185,16 +189,13 @@ def solve_node(G, node_name, edge_name_col='id', split_on='-',
185189
node_obj[vol_eff_col] = vol_eff
186190

187191
node_obj[vol_red_col] = vol_reduced
188-
node_obj[pct_vol_red_col] = 100 * \
189-
_safe_divide(vol_reduced, vol_in)
192+
node_obj[pct_vol_red_col] = 100 * _safe_divide(vol_reduced, vol_in)
190193

191194
node_obj[vol_tmnt_col] = vol_treated
192-
node_obj[pct_vol_tmnt_col] = 100 * \
193-
_safe_divide(vol_treated, vol_in)
195+
node_obj[pct_vol_tmnt_col] = 100 * _safe_divide(vol_treated, vol_in)
194196

195197
node_obj[vol_cap_col] = vol_captured
196-
node_obj[pct_vol_cap_col] = 100 * \
197-
_safe_divide(vol_captured, vol_in)
198+
node_obj[pct_vol_cap_col] = 100 * _safe_divide(vol_captured, vol_in)
198199

199200
#-----solve volume weighted loads-----#
200201
for load_col in load_cols:

0 commit comments

Comments
 (0)