Skip to content

Commit

Permalink
Fix deprecation errors due to implicitly converting a single element
Browse files Browse the repository at this point in the history
numpy array to a numeric type
  • Loading branch information
dagewa committed Feb 17, 2025
1 parent bacd72b commit f46dd8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nxmx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ def underload_value(self) -> int | None:
to the underload_value.
"""
if "underload_value" in self._handle:
return int(self._handle["underload_value"][()])
return int(self._handle["underload_value"][()].item())
return None

@cached_property
Expand All @@ -932,7 +932,7 @@ def saturation_value(self) -> int | None:
"""
if "saturation_value" in self._handle:
try:
return int(self._handle["saturation_value"][()])
return int(self._handle["saturation_value"][()].item())
except TypeError as e:
logger.warning(f"Error extracting {self.path}/saturation_value: {e}")
return None
Expand Down

0 comments on commit f46dd8f

Please sign in to comment.