Skip to content

Commit

Permalink
more mypy error fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-p-2000 committed Dec 23, 2024
1 parent acc783e commit 7dff0c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sleepecg/io/sleep_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ def _parse_nsrr_xml(xml_filepath: Path) -> _ParseNsrrXmlResult:
raise RuntimeError(f"EpochLength not found in {xml_filepath}.")
epoch_length = int(epoch_length)

recording_duration = root.find(".//ScoredEvent").findtext(".//Duration")
if recording_duration is not None:
recording_duration = float(recording_duration)
scored_event = root.find(".//ScoredEvent")
if scored_event is not None:
recording_duration = float(scored_event.findtext(".//Duration"))
else:
raise ValueError(f"Recording duration not found in {xml_filepath}.")

Expand Down

0 comments on commit 7dff0c3

Please sign in to comment.