Skip to content

Commit

Permalink
Avoid deprecated implicit single elt numpy array conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
dagewa authored Mar 5, 2025
2 parents bacd72b + f46dd8f commit 9472655
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 9472655

Please sign in to comment.