Skip to content
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

BUG: h3.api.(basic|numpy|memview)_int can't be loaded via __import__ #304

Open
Zeroto521 opened this issue Dec 17, 2022 · 4 comments
Open

Comments

@Zeroto521
Copy link

>>>  __import__("h3.api.basic_int").h3_is_valid(612845052823076863))
False
>>> __import__("h3.api.memview_int").h3_is_valid(612845052823076863)
False
>>> __import__("h3.api.numpy_int").h3_is_valid(612845052823076863)
False
>>> __import__("h3").api.basic_int.h3_is_valid(612845052823076863)
True
>>> __import__("h3").api.memview_int.h3_is_valid(612845052823076863)
True
>>> __import__("h3").api.numpy_int.h3_is_valid(612845052823076863)
True
>>> import h3
>>> h3.versions()
{'c': '3.7.1', 'python': '3.7.6'}
@kylebarron
Copy link
Contributor

The h3 python version is also important to know for this

@dfellis
Copy link
Collaborator

dfellis commented Dec 23, 2022

It says the python version is 3.7.6?

@kylebarron
Copy link
Contributor

Oh I assumed that was saying the Python runtime was 3.7.6, not the h3 package version. That does make more sense that it's the H3 Python package version.

Back to the original question then... So this is after the changes from dynamically-generated global functions to methods on a class. I don't really understand how the import doesn't fail but instead gives an incorrect result. Maybe it's relevant that the classes are two different places in memory:

In [8]: __import__("h3").api.memview_int.h3_is_valid
Out[8]: <bound method _API_FUNCTIONS.h3_is_valid of <h3.api._api_template._API_FUNCTIONS object at 0x110aed8d0>>

In [9]: __import__("h3.api.memview_int").h3_is_valid
Out[9]: <bound method _API_FUNCTIONS.h3_is_valid of <h3.api._api_template._API_FUNCTIONS object at 0x110aefc70>>

@Zeroto521
Copy link
Author

Zeroto521 commented Dec 23, 2022

  • python version is 3.11
  • h3-py version is 3.7.6

Oh I assumed that was saying the Python runtime was 3.7.6, not the h3 package version. That does make more sense that it's the H3 Python package version.

the latest release h3-py version is 3.7.6

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

No branches or pull requests

3 participants