Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sierra-moxon committed May 28, 2024
1 parent 6b466d5 commit 9ccd5a0
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions bmt/toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,22 +441,24 @@ def get_associations(
A list of elements
"""
filtered_elements: List[str] = list()
inverse_predicates: Optional[List[str]] = None
subject_categories_formatted = []
for sc in subject_categories:
sc_formatted = format_element(self.get_element(sc))
subject_categories_formatted.append(sc_formatted)
object_categories_formatted = []
for oc in object_categories:
oc_formatted = format_element(self.get_element(oc))
object_categories_formatted.append(oc_formatted)
predicates_formatted = []
for pred in predicates:
pred_formatted = format_element(self.get_element(pred))
predicates_formatted.append(pred_formatted)
association_elements = self.get_descendants("association")
filtered_elements: List[str] = list()
inverse_predicates: Optional[List[str]] = None
if predicates_formatted:
if subject_categories:
for sc in subject_categories:
sc_formatted = format_element(self.get_element(sc))
subject_categories_formatted.append(sc_formatted)
if object_categories:
for oc in object_categories:
oc_formatted = format_element(self.get_element(oc))
object_categories_formatted.append(oc_formatted)
if predicates:
for pred in predicates:
pred_formatted = format_element(self.get_element(pred))
predicates_formatted.append(pred_formatted)
inverse_predicates = list()
for pred_curie in predicates_formatted:
predicate = self.get_element(pred_curie)
Expand All @@ -466,6 +468,8 @@ def get_associations(
inverse_predicates.append(inverse_p)
inverse_predicates = self._format_all_elements(elements=inverse_predicates, formatted=True)



if subject_categories_formatted or predicates_formatted or object_categories_formatted:
# This feels like a bit of a brute force approach as an implementation,
# but we just use the list of all association names to retrieve each
Expand Down

0 comments on commit 9ccd5a0

Please sign in to comment.