comparison globalneighbors/grid.py @ 9:638fad06e556

use bisect function; it has been tested faster
author Jeff Hammel <k0scist@gmail.com>
date Sun, 25 Jun 2017 11:37:52 -0700
parents 254195d0bac2
children 21ed15391e8a
comparison
equal deleted inserted replaced
8:e3d6919130ca 9:638fad06e556
54 else: 54 else:
55 jmat.append(j+1) 55 jmat.append(j+1)
56 56
57 return [(_i, _j) for _i in imat for _j in jmat 57 return [(_i, _j) for _i in imat for _j in jmat
58 if (_i,_j) != (i,j)] 58 if (_i,_j) != (i,j)]
59
60 def neighbor_points(self, i, j):
61 """return all points in a lat-lon box"""
62 raise NotImplementedError('TODO') # -> record TODO items