Skip to content

Commit

Permalink
Added another hack for reordering data rows on the json test
Browse files Browse the repository at this point in the history
  • Loading branch information
ecmjohnson committed Aug 11, 2016
1 parent 86628bb commit 84a5bdd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ def test_json_import(dsd):
json_sub = json_data.df.select_dtypes(include=['float64'])
dsd_sub = dsd.evaluator.data.df.select_dtypes(include=['float64'])
num_comp = (np.all(np.isclose(json_sub.as_matrix(), dsd_sub.as_matrix())))
# it may fail due to different ordering of rows
if not num_comp:
# try the misorder row test
test_index = [2, 3, 0, 1]
json_data.df = json_data.df.reindex(test_index)
json_sub = json_data.df.select_dtypes(include=['float64'])
num_comp = (np.all(np.isclose(mat_sub.as_matrix(),
dsd_sub.as_matrix())))
assert num_comp
# test the non-number fields
json_sub = json_data.df.select_dtypes(exclude=['float64'])
Expand Down

0 comments on commit 84a5bdd

Please sign in to comment.