From fa35c63f6e5b154ffe4d37fc3369419d887b43e8 Mon Sep 17 00:00:00 2001 From: ehennestad Date: Tue, 1 Jul 2025 09:48:14 +0200 Subject: [PATCH 1/2] Update Zarr.m Convert keys to MATLAB keys instead of full dictionary --- Zarr.m | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Zarr.m b/Zarr.m index 7c6fa9a..1dfdcc1 100644 --- a/Zarr.m +++ b/Zarr.m @@ -33,9 +33,15 @@ % Check if the ZarrPy module is loaded already. If not, load % it. - sys = py.importlib.import_module('sys'); - loadedModules = dictionary(sys.modules); - if ~loadedModules.isKey("ZarrPy") + try + sys = py.importlib.import_module('sys'); + loadedModuleNames = string( py.list( sys.modules.keys() ) ); + requiresZarrPyReload = any(loadedModuleNames == "ZarrPy"); + catch + requiresZarrPyReload = true; + end + + if requiresZarrPyReload zarrModule = py.importlib.import_module('ZarrPy'); py.importlib.reload(zarrModule); end From ad4f9721bd84a8163460c5ed4a786a439a60d194 Mon Sep 17 00:00:00 2001 From: ehennestad Date: Tue, 1 Jul 2025 09:59:43 +0200 Subject: [PATCH 2/2] Update Zarr.m Fix bug. Add missing not --- Zarr.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zarr.m b/Zarr.m index 1dfdcc1..9bdd83e 100644 --- a/Zarr.m +++ b/Zarr.m @@ -36,7 +36,7 @@ try sys = py.importlib.import_module('sys'); loadedModuleNames = string( py.list( sys.modules.keys() ) ); - requiresZarrPyReload = any(loadedModuleNames == "ZarrPy"); + requiresZarrPyReload = ~any(loadedModuleNames == "ZarrPy"); catch requiresZarrPyReload = true; end