gboeing/osmnx

OSMnx 2.0 Migration Guide

gboeing opened this issue · 5 comments

Overview

OSMnx 2.0.0 is targeted for release later in 2024. This major release includes some breaking changes (including removing previously deprecated functionality) that are not backwards compatible with v1. This issue provides guidance on migrating from v1 to v2. It will be updated as more details are finalized.

Beta testers needed

Testers needed! OSMnx 2.0.0 is now in beta. You can help test it by installing the latest pre-release. Create a virtual environment then run pip install --pre osmnx

Anticipated release schedule:

  • 2.0.0b0 in early May
  • 2.0.0b1 in late July
  • 2.0.0b2 in late September
  • 2.0.0rc0 in late November
  • 2.0.0 on January 1

Migrating to v2

The easiest way to ensure your code is fully compatible with OSMnx v2 is to install the latest v1 release (currently 1.9.3), then run your code. The latest v1 release will remain compatible with the v1 API, but any deprecated functionality you're using will issue a FutureWarning with simple guidance to make it v2 compatible. Additionally, you can:

  • try out the latest 2.0.0 beta pre-release as described above.
  • refer to the new official OSMnx reference paper up-to-date for v2
  • check out the Examples Gallery, which has been updated for v2 compatibility if you're looking for sample code
  • see the changelog for details

Key changes

The three biggest overarching changes in 2.0 are:

  1. The package is now fully type-annotated throughout.
  2. Several modules have been wholly refactored for performance optimization.
  3. The package's API has been streamlined and made more consistent, including some breaking changes and some moved/renamed functions.

In addition to these, there have been many smaller enhancements, fixes, and changes. See the changelog for details and see the latest documentation for an up-to-date user reference.

The first OSMnx v2.0.0 pre-release (beta0) has been released. Testers needed!

Briefly tested beta0 on a few of my existing notebooks. No major issues so far!

I'm also seeing no major/unexpected issues thus far.

No issues observed on a couple of my typical use cases !

Noting there in case the FutureWarning coming from Geopandas in the 1.0.0 latest version when calling geopandas.GeoSeries.unary_union(), in osmnx.graph.graph_from_place(), or osmnx.plot.plot_figure_ground() for instance.

Thanks @csebastiao. I'll make sure to resolve that FutureWarning before the next 2.0 beta release. I'm also planning to release a final patch version of 1.x at some point with pinned max dependency versions to avoid future dependency deprecation issues.