Skip to content

Commit

Permalink
name the indexes
Browse files Browse the repository at this point in the history
Pandas testing functions now compare index names so we need to name them to get the tests to pass.
  • Loading branch information
fscottfoti committed May 18, 2015
1 parent ff0c8e0 commit a238459
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ def test_vts():
pdt.assert_series_equal(
choices,
pd.Series([20, 20, 30, 30, 20],
index=[0, 2, 3, 1, 4]))
index=pd.Index([0, 2, 3, 1, 4], name='index')))
6 changes: 4 additions & 2 deletions activitysim/defaults/test/test_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@ def test_mini_run(store):
# this is a regression test so that we know if these numbers change
auto_choice = orca.get_table('households').get_column('auto_ownership')
print auto_choice[[2306822, 652072, 651907]]
print pd.Series(
[2, 1, 1], index=[2306822, 652072, 651907], name="HHID")

pdt.assert_series_equal(
auto_choice[[2306822, 652072, 651907]],
pd.Series(
[2, 1, 1], index=[2306822, 652072, 651907]))
[2, 1, 1], index=pd.Index([2306822, 652072, 651907], name="HHID")))

orca.run(["cdap_simulate"])

Expand All @@ -98,7 +100,7 @@ def test_mini_run(store):
mtf_choice[[146642, 642922, 642921]],
pd.Series(
['school2', 'work1', 'school2'],
index=[146642, 642922, 642921]))
index=pd.Index([146642, 642922, 642921], name="PERID")))

orca.clear_cache()

Expand Down

0 comments on commit a238459

Please sign in to comment.