Skip to content

Commit

Permalink
Fixed mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
JosePizarro3 committed Feb 13, 2024
1 parent 2ab2ed2 commit 0cf6581
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions simulationdataschema/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ def get_sibling_section(
"""
if not sibling_section_name:
logger.warning("The sibling_section_name is empty.")
return
return None
sibling_section = section.m_xpath(f"m_parent.{sibling_section_name}", dict=False)
# If the sibling_section is a list, return the element `index_sibling` of that list
if isinstance(sibling_section, list):
if index_sibling >= len(sibling_section):
logger.warning("The index of the sibling_section is out of range.")
return
return None
return sibling_section[index_sibling]
return sibling_section

0 comments on commit 0cf6581

Please sign in to comment.