synthicity/urbansim — pull request #31 by jiffyclub (2014-05-27 23:48:06+00:00)
Title: Monkeypatch patsy with with faster handling of boolean categoricals

In urbansim we know that data passing through patsy will always be pandas Series instances. We can capitalize on that in a couple places to avoid expensive categorical nan checking. What we do instead is to check the dtype of the data and if it is boolean take appropriate action without actually looking at the data.

Actually patched are the function `patsy.categorical.categorical_to_int` and the method `patsy.categorical.CategoricalSniffer.sniff`.

There may end up being discussion around these changes on a PR I submitted to patsy at pydata/patsy#44.