Skip to content

adapt for numpy 2.0#922

Open
vincentsarago wants to merge 1 commit intohugapi:developfrom
vincentsarago:patch/adapt-for-numpy2.0
Open

adapt for numpy 2.0#922
vincentsarago wants to merge 1 commit intohugapi:developfrom
vincentsarago:patch/adapt-for-numpy2.0

Conversation

@vincentsarago
Copy link
Copy Markdown

np.unicode_ has been removed in Numpy 2.0

hug/hug/output_format.py

Lines 145 to 147 in e4a3fa4

@json_convert(str, numpy.unicode_)
def numpy_stringable(item):
return str(item)

   import hug
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/hug/__init__.py", line 36, in <module>
    from hug import (
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/hug/output_format.py", line 145, in <module>
    @json_convert(str, numpy.unicode_)
                       ^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/numpy/__init__.py", line 397, in __getattr__
    raise AttributeError(
AttributeError: `np.unicode_` was removed in the NumPy 2.0 release. Use `np.str_` instead.

@vincentsarago vincentsarago changed the title adapt for python 2.0 adapt for numpy 2.0 Jul 4, 2024
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