Skip to content

Commit

Permalink
use suggested np.isscalar
Browse files Browse the repository at this point in the history
  • Loading branch information
nvaytet committed Apr 20, 2023
1 parent e7d5131 commit 1c2d007
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion orsopy/fileio/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def represent_data(self, data):
elif isinstance(data, datetime.datetime):
value = data.isoformat("T")
return super().represent_scalar("tag:yaml.org,2002:timestamp", value)
elif (not np.shape(data)) and hasattr(data, "item"):
elif np.isscalar(data) and hasattr(data, "item"):
# If data is a numpy scalar, convert to a python object
return super().represent_data(data.item())
else:
Expand Down

0 comments on commit 1c2d007

Please sign in to comment.