Skip to content

Conversation

glitch401
Copy link

Pull Request

Description

This PR updates the codebase to be compatible with version 4.x of the h3-py library.
The h3-py library introduced breaking API changes in its v4 release, renaming several core functions (e.g., uncompact -> uncompact_cells, geo_to_h3 -> latlng_to_cell, k_ring -> grid_disk). The existing code was using the old, deprecated function names, which causes AttributeError exceptions for any user with an up-to-date h3 installation.

This commit updates all calls to the h3 library in graph_weather/models/layers/encoder.py and graph_weather/models/layers/assimilator_decoder.py to use the new, correct function names, resolving the dependency conflict.

Fixes #

How Has This Been Tested?

This is a direct API update to fix a dependency incompatibility. The changes were validated by confirming that the code now initializes and runs without the AttributeError exceptions that were previously occurring. The project's existing CI test suite has provided the final validation for correctness.

  • Yes

If your changes affect data processing, have you plotted any changes? i.e. have you done a quick sanity check?

  • Yes

Checklist:

  • My code follows OCF's coding style guidelines
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked my code and corrected any misspellings

Copy link
Member

@jacobbieker jacobbieker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! This is great, thanks! Can you also update the dependency version in the pixi to be the current H3 version?

@glitch401 glitch401 force-pushed the fix/h3-compatibility branch from d0ec4e8 to b05ece7 Compare October 15, 2025 21:59
@glitch401
Copy link
Author

updated pixi :D

pytest = "*"
pytest-xdist = "*"
h3 = "==3.7.7"
h3 = "==4.3.1"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jacobbieker this should do for pixi, right?

@glitch401 glitch401 requested a review from jacobbieker October 15, 2025 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants