Skip to content

Commit 9472655

Browse files
authored
Avoid deprecated implicit single elt numpy array conversion
2 parents bacd72b + f46dd8f commit 9472655

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/nxmx/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ def underload_value(self) -> int | None:
917917
to the underload_value.
918918
"""
919919
if "underload_value" in self._handle:
920-
return int(self._handle["underload_value"][()])
920+
return int(self._handle["underload_value"][()].item())
921921
return None
922922

923923
@cached_property
@@ -932,7 +932,7 @@ def saturation_value(self) -> int | None:
932932
"""
933933
if "saturation_value" in self._handle:
934934
try:
935-
return int(self._handle["saturation_value"][()])
935+
return int(self._handle["saturation_value"][()].item())
936936
except TypeError as e:
937937
logger.warning(f"Error extracting {self.path}/saturation_value: {e}")
938938
return None

0 commit comments

Comments
 (0)