Skip to content

Commit

Permalink
Merge pull request #398 from will-moore/getGridSize_plate_no_wells
Browse files Browse the repository at this point in the history
getGridSize() handles plates with no Wells
  • Loading branch information
jburel authored Apr 24, 2024
2 parents 601a64f + bbf54d7 commit 2864126
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/omero/gateway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6599,6 +6599,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}
"""
Expand All @@ -6610,7 +6611,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):
Expand Down

0 comments on commit 2864126

Please sign in to comment.