UDST / pandana

Pandas Network Analysis by UrbanSim: fast accessibility metrics and shortest paths, using contraction hierarchies :world_map:
http://udst.github.io/pandana
GNU Affero General Public License v3.0
387 stars 83 forks source link

Deprecation warnings to streamline migration from 0.3 to 0.4 #106

Closed smmaurer closed 5 years ago

smmaurer commented 5 years ago

Pandana 0.4 made some changes to the API that cause older user code to crash. We're still running into this in UrbanSim models, and it's hard for people to diagnose the errors if they're not expecting them.

In the next point release, I think we should make some small adjustments to allow older code to continue running, raising deprecation warnings to explain the changes that need to be made:

1. pandana.network.reserve_num_graphs()

This was removed in 0.4 because improvements to the memory management mean that it's no longer necessary. But it appears frequently in older user code.

Current behavior:

Proposed behavior:

2. pandana.Network().init_pois() and set_pois()

In 0.4 init_pois() was removed, and two of its arguments were shifted to set_pois().

Current behavior:

Proposed behavior:

Discussion

Making these changes would allow code written for Pandana 0.3 to continue running, while explaining to users how to make the appropriate updates. I think this would be pretty valuable and save some headaches.

For example, it looks like urbansim itself still pins its pandana requirement at 0.3, presumably because of the API changes -- this should make migration easier.

smmaurer commented 5 years ago

More info from @sablanchard: UrbanSim is pinned at Pandana v0.3 in part because 0.4.0 had installation problems in Windows. v0.4.1. fixed this, but UrbanSim hasn't been updated yet to reflect that.

smmaurer commented 5 years ago

Fixed in PR #116, thanks @alephcero!