Skip to content

Commit

Permalink
simplify _get_pos_names
Browse files Browse the repository at this point in the history
  • Loading branch information
ieivanov committed Oct 31, 2023
1 parent bf999b7 commit 082c2f6
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions iohub/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,13 @@ def _get_pos_names(self):
"""Append a list of pos names in ascending order
(order in which they were acquired).
"""
try:
self.pos_names = []
for p in range(self.p):
try:
name = self.reader.stage_positions[p]["Label"]
except (IndexError, KeyError):
name = p
self.pos_names.append(name)
except Exception:
self.pos_names = ["0"]
self.pos_names = []
for p in range(self.p):
try:
name = self.reader.stage_positions[p]["Label"]
except (IndexError, KeyError):
name = str(p)
self.pos_names.append(name)

def _get_image_array(self, p: int, t: int, c: int, z: int):
try:
Expand Down

0 comments on commit 082c2f6

Please sign in to comment.