Skip to content

Commit

Permalink
Merge 5201ce5 into ab346fe
Browse files Browse the repository at this point in the history
  • Loading branch information
jiffyclub committed Mar 19, 2014
2 parents ab346fe + 5201ce5 commit 40febf6
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ install:
- export PATH=$HOME/py/bin:$PATH
- pip install Django shapely simplejson
# install test depencies
- pip install pytest-cov coveralls
- pip install pytest-cov coveralls pep8
# install urbansim
- pip install .
script:
- pep8 urbansim scripts urbansimd
- py.test --cov urbansim --cov-report term-missing
after_success:
- coveralls
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pep8]
exclude = texttable.py
max-line-length = 100
1 change: 0 additions & 1 deletion urbansim/urbansim/tests/test_modelcompile.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,3 @@ def test_load_config_yaml():
config, basename = modelcompile.load_config(test_file)
assert config == TEST_CONFIG
assert basename == 'test_config.yaml'

3 changes: 0 additions & 3 deletions urbansim/utils/geomisc.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ def np_coord_convert_all(a):
a = np.array(pool.map(np_coord_convert, a), dtype="float32")
return a

#bats['origpoint'] = bats['origpoint'].apply(lambda x: x.decode('hex')).apply(shapely.wkb.loads)
#bats['destpoint'] = bats['destpoint'].apply(lambda x: x.decode('hex')).apply(shapely.wkb.loads)


def convert_df(df, xname='x', yname='y', srcsrid=3740, tgtsrid=4326):
x = df[xname].values
Expand Down
10 changes: 6 additions & 4 deletions urbansimd/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
jdata = {
"tables": ['parcels'],
# "tables": ['residential_rent'],
# "variable": """subset['building_sqft'].groupby(level=0).transform('sum') / \
# (subset['shape_area'].groupby(level=0).transform('mean')*10.7639)""",
# "variable": """subset[(subset['building_type_id'] < 4)*(subset['year_built'] < 1950)].groupby('zone_id')['building_sqft'].transform('sum')""",
# "variable": """subset[_YEARS_].groupby(level=0).mean()""",
"variable": ("subset['building_sqft'].groupby(level=0).transform('sum') / "
"(subset['shape_area'].groupby(level=0).transform('mean')*10.7639)"),
"variable": ("subset[(subset['building_type_id'] < 4) * "
"(subset['year_built'] < 1950)]"
".groupby('zone_id')['building_sqft'].transform('sum')"),
"variable": "subset[_YEARS_].groupby(level=0).mean()",
"variable": "subset['parcel_acres']",
# "bbox": [550000,4180000,550100,4180100],
"bbox": [1500000, 1500000, 1500500, 1500500],
Expand Down
3 changes: 2 additions & 1 deletion urbansimd/urbansimd-postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def start_service(username, password, port=8765, host='paris.urbansim.org'):
pass
global conn
conn = psycopg2.connect(
"dbname=bayarea user=%s password=%s port=5432 host=paris.urbansim.org" % (username, password))
"dbname=bayarea user=%s password=%s port=5432 host=paris.urbansim.org" %
(username, password))
run(host=host, port=port, debug=True, server='tornado')

if __name__ == '__main__':
Expand Down

0 comments on commit 40febf6

Please sign in to comment.