Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Christoph Zwerschke <c.zwerschke@dkfz-heidelberg.de>
  • Loading branch information
lkuchenb and Cito committed May 14, 2024
1 parent 2b95f57 commit 3d7860f
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@ def get_relation(element: RelationPathElement, schema: SchemaPack) -> Relation:
Returns:
The relation object.
"""
if element.type_ == RelationPathElementType.ACTIVE:
class_ = schema.classes[element.source]
else:
class_ = schema.classes[element.target]
return class_.relations[element.property]
element_active = element.type_ == RelationPathElementType.ACTIVE
class_name = element.source if element_active else element.target
return schema.classes[class_name].relations[element.property]


def infer_mutiplicity_from_path(
Expand Down

0 comments on commit 3d7860f

Please sign in to comment.