Skip to content

Commit

Permalink
More changes to fix tests
Browse files Browse the repository at this point in the history
This might impact older numpy versions, so there could be better
ways to preserve backwards compatibility
  • Loading branch information
torrinba committed Jun 17, 2024
1 parent 2893b0a commit 1d5344a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion omas/omas_ascii.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


def identify_imas_type(value):
if isinstance(value, (str, numpy.bytes_, numpy.unicode_, numpy.str_)):
if isinstance(value, (str, numpy.bytes_, numpy.str_)):
dtype = dict(type='50 (CHAR_DATA)', dim=1, size=(len(value),))
elif isinstance(value, (float, numpy.floating)):
dtype = dict(type='52 (DOUBLE_DATA)', dim=0)
Expand Down
2 changes: 1 addition & 1 deletion omas/omas_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def force_imas_type(value):
value = value.values
if isinstance(value, numpy.ndarray) and not len(value.shape):
value = value.item()
if isinstance(value, (numpy.bytes_, numpy.unicode_, numpy.str_)):
if isinstance(value, (numpy.bytes_, numpy.str_)):
value = value.item()
elif isinstance(value, (float, numpy.floating)):
value = float(value)
Expand Down

0 comments on commit 1d5344a

Please sign in to comment.