pysal/pysal — pull request #381 by jlaura (2013-12-27 16:51:15+00:00)
Title: Weights

Added an improved contiguity checking method. This is passing tests locally. It would be ideal to also test performance on different hardware platforms. I do not know how the python collections module performs on Windows machines. I assume that it is similar in performance on *nix machines.

In contrast the binning approach, this scale linearly. In the performance testing the final assert statements check:
`binning queen == rtree queen == list queen`
`binning rook == rtree rook == list rook`

In the parallel repo, [weights directory](https://github.com/pysal/pPysal/blob/master/weights/EvenFasterSerialContiguity.ipynb) is an ipynb with the research code prior to integration. I do not provide all the sample shape files as they get quite large quite quickly. If you want to test using those, ping me and I'll get them onto dropbox.

Performance using the NAT.shp example file:
```bash
air:weights jay$ python _contW_binning.py
BINNING
using /Users/Jay/github/pysal/pysal/examples/NAT.shp
time elapsed for queen... using bins: 1.2887699604
Rook binning
using /Users/Jay/github/pysal/pysal/examples/NAT.shp
time elapsed for rook... using bins: 1.86196613312

RTREE
using /Users/Jay/github/pysal/pysal/examples/NAT.shp
time elapsed for queen... using rtree: 9.58639001846
time elapsed for rook... using rtree: 10.2511389256

LISTS
using /Users/Jay/github/pysal/pysal/examples/NAT.shp
time elapsed for queen... using lists: 0.665349960327
using /Users/Jay/github/pysal/pysal/examples/NAT.shp
time elapsed for rook... using lists: 0.957465171814

ASSERTING EQUAL
True
True
```