Skip to content

Commit

Permalink
Support numpy version 2
Browse files Browse the repository at this point in the history
  • Loading branch information
lmassach committed Jul 17, 2024
1 parent 3df4cf2 commit 7566093
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion vitables/csv/csvutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

# https://github.com/numpy/numpy/issues/10990
import warnings
warnings.filterwarnings("ignore", category=numpy.VisibleDeprecationWarning)
warnings.filterwarnings("ignore", category=numpy.exceptions.VisibleDeprecationWarning)


translate = QtWidgets.QApplication.translate
Expand Down
2 changes: 1 addition & 1 deletion vitables/nodeprops/attrpropdlg.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def fillSysAttrsPage(self, info):
# isinstance(asi.test, int) returns True
# asi.test.shape returns ()
# asi.test2 = "hello" ->
# type(asi.test2) returns numpy.string_
# type(asi.test2) returns numpy.bytes_
# isinstance(asi.test2, str) returns True
# asi.test2.shape returns ()
# Beware that objects whose shape is () are not warranted
Expand Down
2 changes: 1 addition & 1 deletion vitables/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def formatArrayContent(content):
:Parameter content: the ``numpy`` array contained in the view cell
"""

if isinstance(content, numpy.string_):
if isinstance(content, numpy.bytes_):
try:
return content.decode(DEFAULT_ENCODING)
except UnicodeDecodeError:
Expand Down

0 comments on commit 7566093

Please sign in to comment.