Skip to content

Commit

Permalink
fix bug determining number of rows and cols
Browse files Browse the repository at this point in the history
  • Loading branch information
ieivanov committed Mar 8, 2024
1 parent 3ab89ba commit 9e8fa4d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions iohub/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ def _make_default_grid(self):
)

def _get_position_coords(self):
row_max = 0
col_max = 0
rows = set()
cols = set()
coords_list = []

# TODO: read rows, cols directly from XY corods
Expand All @@ -196,16 +196,14 @@ def _get_position_coords(self):
)
coords_list.append(stage_pos)
try:
row = pos["GridRow"]
col = pos["GridCol"]
rows.add(pos["GridRow"])
cols.add(pos["GridCol"])
except KeyError:
raise ValueError(
f"Grid indices not available for position {idx}"
)
row_max = row if row > row_max else row_max
col_max = col if col > col_max else col_max

return coords_list, row_max + 1, col_max + 1
return coords_list, len(rows), len(cols)

def _get_pos_names(self):
"""Append a list of pos names in ascending order
Expand Down

0 comments on commit 9e8fa4d

Please sign in to comment.