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

check if np.inf exists (NumPy 2.0+) and use it instead of depricateted np.Infinity #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

roworu
Copy link

@roworu roworu commented Jan 31, 2025

With numpy version 2.0+ using wizmap.generate_grid_dict throws such error:

  File "/my_cool_project/wizmap/.venv/lib/python3.13/site-packages/wizmap/wizmap.py", line 565, in generate_topic_dict
    min_level, max_level = select_topic_levels(
                           ~~~~~~~~~~~~~~~~~~~^
        max_zoom_scale,
        ^^^^^^^^^^^^^^^
    ...<5 lines>...
        ideal_tile_width,
        ^^^^^^^^^^^^^^^^^
    )
    ^
  File "/my_cool_project/wizmap/.venv/lib/python3.13/site-packages/wizmap/wizmap.py", line 497, in select_topic_levels
    best_tile_width_diff = np.Infinity
                           ^^^^^^^^^^^
  File "/my_cool_project/wizmap/.venv/lib/python3.13/site-packages/numpy/__init__.py", line 400, in __getattr__
    raise AttributeError(
    ...<3 lines>...
    )
AttributeError: `np.Infinity` was removed in the NumPy 2.0 release. Use `np.inf` instead.

That PR just adds check if np.inf is avaliable and uses it if so

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.

1 participant