hive icon indicating copy to clipboard operation
hive copied to clipboard

uber h3 is now at version 4.0 with breaking API changes

Open robfitzgerald opened this issue 2 years ago • 7 comments

noted today that h3 is now at 4.0. the 4.0 API changes the name of methods. straight off the top of the documentation, the 3.x geo_to_h3 and h3_to_geo functions have been renamed latlng_to_cell and cell_to_latlng.

a quick immediate update is to restrict h3 versions to 3.x in our pyproject.toml, and long-term, we should update to the latest version or provide an abstraction to support both versions.

note: most h3 functionality occurs in h3_ops.py.

robfitzgerald avatar Mar 08 '23 15:03 robfitzgerald

Would like to move to version 4, import h3 20 files total that need to be updated rg 'import h3' | wc -l

clintonsteiner avatar Apr 24 '23 14:04 clintonsteiner

https://h3geo.org/docs/library/migration-3.x/functions looks like the functions were just renamed, working on updating now

clintonsteiner avatar Apr 24 '23 14:04 clintonsteiner

3.7.6 is latest stable version find . -type f -exec sed -i 's/h3.geo_to_h3/h3.latLngToCell/g' {} ; Here is the sed command I used to begin updating using the reference above https://github.com/uber/h3-py

clintonsteiner avatar Apr 24 '23 14:04 clintonsteiner

Considering that version 4.0 isn't yet stable we should probably hold off on including it as a required dependency. Maybe we defer this until 4.0 is the de-facto version?

nreinicke avatar Apr 24 '23 14:04 nreinicke

3.7.6 is latest stable version

right. sorry, i only checked the base library when i created this ticket. it appears that the python bindings for the core h3 library haven't caught up to the v4.1.0 c lib. and, ya, let's hold off on committing then until 4+ goes stable for python. should we create a temp branch off the hive repo to merge this work into? thanks for your work @clintonsteiner.

robfitzgerald avatar Apr 24 '23 15:04 robfitzgerald

Going to have a tough time replacing polyfill, leaving that for your team. Only one usage in geofence.py, replacements are cells_to_polygon or polygon_to_cells

clintonsteiner avatar Apr 25 '23 15:04 clintonsteiner

https://github.com/NREL/hive/pull/181 Put this in draft status here, until uber h3 goes stable

clintonsteiner avatar Apr 25 '23 15:04 clintonsteiner