Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug determining number of rows and cols #214

Merged
merged 3 commits into from
Mar 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading