Mercurial > hg > GlobalNeighbors
comparison tests/test_grid.py @ 11:d1b99c695511
remove obselete data
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sun, 25 Jun 2017 12:54:05 -0700 |
parents | 254195d0bac2 |
children |
comparison
equal
deleted
inserted
replaced
10:21ed15391e8a | 11:d1b99c695511 |
---|---|
50 | 50 |
51 filename = datafile('10000cities.tsv') | 51 filename = datafile('10000cities.tsv') |
52 assert os.path.exists(filename) | 52 assert os.path.exists(filename) |
53 with open(filename) as f: | 53 with open(filename) as f: |
54 city_locations = locations(read_cities(f)) | 54 city_locations = locations(read_cities(f)) |
55 self.grid_locations(city_locations) | 55 grid = self.grid_locations(city_locations) |
56 | 56 |
57 def test_neighbors(self): | 57 def test_neighbors(self): |
58 """test grid neighbor indexing""" | 58 """test grid neighbor indexing""" |
59 | 59 |
60 grid = LatLonGrid(9, 9) | 60 grid = LatLonGrid(9, 9) |
83 for i in range(grid.n[0]): | 83 for i in range(grid.n[0]): |
84 for j in range(grid.n[1]): | 84 for j in range(grid.n[1]): |
85 n_locations += len(grid[(i,j)]) | 85 n_locations += len(grid[(i,j)]) |
86 assert n_locations == len(locations) | 86 assert n_locations == len(locations) |
87 | 87 |
88 | 88 return grid |
89 | 89 |
90 if __name__ == '__main__': | 90 if __name__ == '__main__': |
91 unittest.main() | 91 unittest.main() |