From 1a000acb5c6f70a4cf4563d187e07ee015b5f344 Mon Sep 17 00:00:00 2001
From: David Hammer <dhammer@mailbox.org>
Date: Thu, 16 Jan 2025 11:35:19 +0100
Subject: [PATCH] Maybe fix: np.asarray, let it decide whether to copy

---
 src/calng/frameselection_utils.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/calng/frameselection_utils.py b/src/calng/frameselection_utils.py
index 9b444e56..edd9b612 100644
--- a/src/calng/frameselection_utils.py
+++ b/src/calng/frameselection_utils.py
@@ -138,9 +138,9 @@ class FrameselectionFriend:
 
     def get_mask(self, sources):
         if self._enabled and self._arbiter in sources:
-            return np.array(
-                sources[self._arbiter][0]["data.dataFramePattern"], copy=False
-            ).astype(bool, copy=False)
+            return np.asarray(
+                sources[self._arbiter][0]["data.dataFramePattern"], dtype=bool
+            )
         else:
             return None
 
@@ -171,8 +171,7 @@ class FrameselectionFriend:
                 if not arbiter.has(mask_key):
                     # no mask
                     continue
-                mask = np.array(
-                    arbiter[mask_key], dtype=bool, copy=False)
+                mask = np.asarray(arbiter[mask_key], dtype=bool)
 
                 for source, data in correction_sources.items():
                     if not data.has(arg):
-- 
GitLab