-
Notifications
You must be signed in to change notification settings - Fork 828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OSMnx 2.0 Migration Guide #1123
Comments
controller.py:431: FutureWarning: The `north`, `south`, `east`, and `west` parameters are deprecated and will be removed in the v2.0.0 release. Use the `bbox` parameter instead. See the OSMnx v2 migration guide: gboeing/osmnx#1123 polygon = ox.utils_geo.bbox_to_poly(north, south, east, west) controller.py:733: FutureWarning: The `north`, `south`, `east`, and `west` parameters are deprecated and will be removed in the v2.0.0 release. Use the `bbox` parameter instead. See the OSMnx v2 migration guide: gboeing/osmnx#1123 graph = ox.graph_from_bbox() `north`, `south`, `east`, `west` parameters are deprecated use `bbox` as tuple parameter instead
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 |
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. |
Can we add a Breaking changes section somewhere (here or in the changelog)? To make things like changing the bounds order stand our a little more. |
This code, which worked on OSMnx 1.x: road_network = ox.load_graphml("merged_network.graphml")
city_name = "Rotterdam"
surrounding_area_name = "South Holland"
color_map = {city_name: 'red', surrounding_area_name: 'blue'}
edge_colors = [color_map[road_network.edges[edge]['network']] for edge in road_network.edges] Now breaks on 2.0.
Has anything changed in the edge view? |
Sorry, it looks like this isn't a OSMnx, since the same error appear when using OSMnx 1.9.3. Did anything change in GeoPandas, NetworkX or an other dependency? |
I can't guess because I can't reproduce your error. However, if it is a dependency issue for OSMnx, it'll be resolved on the OSMnx side in the 1.9.4 release as we have pinned max dependency versions. |
Yeah I think it was something on my side. If I encounter it again I will create a minimal reproducible example. |
See gboeing/osmnx#1123 for more info
As per the above commit, we're trying to install a version of Error message:
As far as I can tell from the conversation above, it should be compatible with geopandas 1.0.0 but will check... Any ideas welcome, see here for details: geocompx/geocompy#241 |
OK, seems it's an issue with installing the latest version of Line 3 in 8df6d7a
|
Have tried to install the latest version with
but that seems to get v1.9.4, right? |
Update: no, after testing with the following reproducible example:
|
Will try with: pip install --no-cache-dir --upgrade --pre osmnx |
I would expect #1123 (comment) to work. |
Yes it did, although that was being overridden in our workflow. Fixed longer term (in a way that will keep updating to the latest versions) with the following command before running pur -r requirements.txt --pre osmnx Source: geocompx/geocompy@30ffd68 |
By the way, as a relative Python novice, I'm interested in best practice and would welcome any suggestions on how to improve our set-up/installation/CI game. |
Numpy's latest version of 2.1.0rc1 and osmnx's 2.0.0b1 are incompatible. When converting osm data, when I look at the log history, when the tool invokes the coordinate values, it prepends a number with float64. If you look at the 2.0.0 version release of numpy, you can see that float_ has been deleted and replaced by float64. Please let me know the most stable versions of numpy and other tools that are compatible. |
@jamongadejoa28 OSMnx 2.0 should be fully compatible with Numpy 2.0. If you discover a specific incompatibility, please open a new issue with complete troubleshooting details so we can resolve it. |
I'm now changing the order of the coordinates in public examples. It's a bit weird to need to stay on a beta release for almost half a year. Maybe I'm too early, but I would support going a lot faster with the 2.0 release schedule. Even huge projects as NumPy or Pandas have way shorter pre-release periods. Maybe something like:
|
Am I understanding correctly that OSMnx 2.0 will be the first release with NumPy 2 compatibility (and the OSMnx 1.x series will be limited to NumPy 1)? Sorry if I'm asking something that is clarified elsewhere, had a hard time finding the answer when searching (with the exception of |
@jakirkham correct. We're not updating the 1.x branch further (outside of bug fixes or deprecation warnings necessary for transitioning to v2). However, if dependency version incompatibility poses a real problem for the community in the meantime, I'm always happy to review a new issue documenting the problem and proposing a minimal PR to resolve it. |
Beta 2 has been released with:
|
OSMnx 2.0.0 has been released. |
Congratulations! Thanks for all your hard and continued work on OSMnx. |
Overview
OSMnx 2.0.0 was released in November 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.
Migrating to v2
If you want to ensure your code is fully compatible with OSMnx v2 before upgrading to it, you can install the latest v1 release (currently
1.9.4
), 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:Key changes
The three biggest overarching changes in 2.0 are:
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 text was updated successfully, but these errors were encountered: