BayAreaMetro / bayarea_urbansim

Bay Area Version of the UrbanSim Model
http://bayareametro.github.io/bayarea_urbansim
13 stars 11 forks source link

Notes about dependency versions and compatibility #125

Open smmaurer opened 4 years ago

smmaurer commented 4 years ago

To have this written down:

Python

Python itself doesn't change much in new 3.x releases (and we're not using any cutting edge features) -- the main issue is that compiled numerical libraries need to provide new binaries for each Python version. Big ones like NumPy and Pandas are updated quickly, but it can take longer for niche libraries like Pandana or PyTables (which UrbanSim uses for HDF i/o) to provide support.

Operating systems

One cross-platform issue we run into is that Pandas sometimes chooses different precision levels for data (like int32 vs int64) depending on the environment it's running in. This can trip up Orca when data tables are being updated -- a good fix is to add the cast=True argument to the update_col_from_series() call. (If the mismatch is more than just precision level, like an int vs. float issue, you should dig deeper to make sure the code is doing the right thing.)

NumPy

A couple of bugs related to changes in NumPy/Pandas default behaviors did come up last year, see PR #99 and issue #96.

Pandas

Statsmodels

Statsmodels is installed as a sub-dependency of UrbanSim, for OLS estimation and simulation. On my machine, pip install statsmodels in Python 2.7 tries to install v0.11, which causes errors, so you need to install v0.10 manually. I'll try to get this fixed in an update to UrbanSim.

Scikit-learn

This is installed as a sub-dependency of Pandana.

Orca

Orca_test

Pandana

More Pandana notes TK.

UrbanSim

UrbanSim_Defaults

fscottfoti commented 4 years ago

My big question would be whether Python2.7 is no longer supported and thus it's ok to use Python3-only features. I guess I'd hope that we'd be there soon.