From 9013e726380603c0f058e164320548872a8cd7d2 Mon Sep 17 00:00:00 2001 From: William Moore Date: Wed, 14 Feb 2024 13:20:22 +0000 Subject: [PATCH 1/2] getGridSize() handles plates with no Wells --- src/omero/gateway/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/omero/gateway/__init__.py b/src/omero/gateway/__init__.py index 229af9d59..a225ea66c 100644 --- a/src/omero/gateway/__init__.py +++ b/src/omero/gateway/__init__.py @@ -6656,7 +6656,10 @@ def getGridSize(self): "where plate.id = :id" res = q.projection(query, params, self._conn.SERVICE_OPTS) (row, col) = res[0] - self._gridSize = {'rows': row.val+1, 'columns': col.val+1} + if row is None or col is None: + self._gridSize = {'rows': 0, 'columns': 0} + else: + self._gridSize = {'rows': row.val+1, 'columns': col.val+1} return self._gridSize def getWellGrid(self, index=0): From bbf54d740f70baee1e5fd5d3fb396699af5095b3 Mon Sep 17 00:00:00 2001 From: William Moore Date: Tue, 19 Mar 2024 22:06:41 +0000 Subject: [PATCH 2/2] add more details to getGridSize() docstring --- src/omero/gateway/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/omero/gateway/__init__.py b/src/omero/gateway/__init__.py index a225ea66c..9d20fd156 100644 --- a/src/omero/gateway/__init__.py +++ b/src/omero/gateway/__init__.py @@ -6645,6 +6645,7 @@ def getGridSize(self): """ Iterates all wells on plate to retrieve grid size as {'rows': rSize, 'columns':cSize} dict. + If the Plate has no Wells, it will return {'rows': 0, 'columns': 0} :rtype: dict of {'rows': rSize, 'columns':cSize} """