From f46dd8f03f3bec509d803bb216a8d1436337b14d Mon Sep 17 00:00:00 2001 From: David Waterman Date: Mon, 17 Feb 2025 09:49:11 +0000 Subject: [PATCH] Fix deprecation errors due to implicitly converting a single element numpy array to a numeric type --- src/nxmx/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nxmx/__init__.py b/src/nxmx/__init__.py index 3fbf560..e0e675a 100644 --- a/src/nxmx/__init__.py +++ b/src/nxmx/__init__.py @@ -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 @@ -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