From 32bc8ffa373d382982b3e3df64b51e744bbf0358 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Al=C3=A1n=20Mu=C3=B1oz?= <amuoz@ed.ac.uk>
Date: Mon, 15 Aug 2022 12:23:49 +0100
Subject: [PATCH] fix(cells): update method of finding tile_size

---
 io/cells.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/io/cells.py b/io/cells.py
index 0fc7b1eb..072ee17d 100644
--- a/io/cells.py
+++ b/io/cells.py
@@ -77,7 +77,8 @@ class Cells:
     def tile_size(self) -> t.Union[int, t.Tuple[int], None]:
         if self._tile_size is None:
             with h5py.File(self.filename, mode="r") as f:
-                self._tile_size = f["trap_info/tile_size"][0]
+                # self._tile_size = f["trap_info/tile_size"][0]
+                self._tile_size = f["cell_info/edgemasks"].shape[1:]
         return self._tile_size
 
     def nonempty_tp_in_trap(self, trap_id: int) -> set:
@@ -99,7 +100,7 @@ class Cells:
         We use mother_assign to list traps because it is the only property that appears even
         when no cells are found
         """
-        return [self.labels_in_trap(trap) for trap in self.traps]
+        return [self.labels_in_trap(trap) for trap in range(self.ntraps)]
 
     def where(self, cell_id: int, trap_id: int):
         """
-- 
GitLab