Skip to content

Commit

Permalink
Update mcd_parser.py
Browse files Browse the repository at this point in the history
Lines 126-129 treat DataStartOffset and DataEndOffset as text.  This generates a warning which is sometimes incorrect.

The offsets should be treated as integers the sort to work as expected.
  • Loading branch information
sandip-shah authored Jul 9, 2024
1 parent c8e90b4 commit 354fd9a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions readimc/mcd_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ def _parse_slide(self, slide_elem: ET.Element) -> Slide:
if panorama is not None:
panorama.acquisitions.append(acquisition)
for a, b in itertools.combinations(slide.acquisitions, 2):
a_start = a.metadata["DataStartOffset"]
a_end = a.metadata["DataEndOffset"]
b_start = b.metadata["DataStartOffset"]
b_end = b.metadata["DataEndOffset"]
a_start = self._get_text_as_int(a.metadata["DataStartOffset"])
a_end = self._get_text_as_int(a.metadata["DataEndOffset"])
b_start = self._get_text_as_int(b.metadata["DataStartOffset"])
b_end = self._get_text_as_int(b.metadata["DataEndOffset"])
if b_start <= a_start < b_end or b_start < a_end <= b_end:
warn(
f"Slide {slide.id} corrupted: "
Expand Down

0 comments on commit 354fd9a

Please sign in to comment.