From dad5cb2c2f86141e0707815f6a8d90f8e455c80e Mon Sep 17 00:00:00 2001 From: u229187 Date: Tue, 12 Aug 2025 07:35:02 +0200 Subject: [PATCH] allow more generic array types in list_matrices --- openmatrix/File.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/openmatrix/File.py b/openmatrix/File.py index c7eb328..d112e36 100644 --- a/openmatrix/File.py +++ b/openmatrix/File.py @@ -136,7 +136,12 @@ def list_matrices(self): matrices : list List of all matrix names stored in this OMX file. """ - return [node.name for node in self.list_nodes(self.root.data,'CArray')] + matrices = [] + if 'data' in self.root: + for node in self.list_nodes(self.root.data): + if isinstance(node, tables.Array) and len(node.shape) == 2: + matrices.append(node.name) + return matrices def list_all_attributes(self):