Skip to content

Commit c287908

Browse files
committed
fix: address copilot comments 2
1 parent 1f021ee commit c287908

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

cellacdc/load.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3659,8 +3659,12 @@ def __init__(self):
36593659

36603660
class OMEXML_Channel:
36613661
def __init__(self, Channel) -> None:
3662-
self.Name = Channel.attrib.get('Name', '')
3663-
self.node = Channel.attrib
3662+
if not Channel or Channel is None:
3663+
self.Name = 'not_found'
3664+
self.node = None
3665+
else:
3666+
self.Name = Channel.attrib.get('Name', '')
3667+
self.node = Channel.attrib
36643668

36653669
class OMEXML_Pixels:
36663670
def __init__(self, Pixels, node, ome_schema) -> None:
@@ -3686,7 +3690,7 @@ def Channel(self, channel_index=0):
36863690
try:
36873691
Channel = self.Pixels.findall(f'{self.ome_schema}Channel')[channel_index]
36883692
except Exception as err:
3689-
Channel = 'not_found'
3693+
Channel = None
36903694
return OMEXML_Channel(Channel)
36913695

36923696
class OMEXML:

0 commit comments

Comments
 (0)