From 117120c0a2a95f20a8fc203329721b226be98a13 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Tue, 12 Mar 2024 14:07:47 +0100 Subject: [PATCH] Npz sniffing: do not read the whole file takes to much memory --- lib/galaxy/datatypes/binary.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/galaxy/datatypes/binary.py b/lib/galaxy/datatypes/binary.py index fa5352918990..0f53030b3d02 100644 --- a/lib/galaxy/datatypes/binary.py +++ b/lib/galaxy/datatypes/binary.py @@ -4299,9 +4299,7 @@ def sniff(self, filename: str) -> bool: try: npz = np.load(filename) if isinstance(npz, np.lib.npyio.NpzFile): - for f in npz.files: - if isinstance(npz[f], np.ndarray): - return True + return True except Exception: return False return False