Skip to content

Commit

Permalink
null check with_from items
Browse files Browse the repository at this point in the history
  • Loading branch information
sierra-moxon committed Nov 21, 2023
1 parent 0b86178 commit 718c35d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ontobio/io/qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,15 @@ def test(self, annotation: association.GoAssociation, config: assocparser.AssocP

okay = True
if evidence == ic_eco:
only_go = [t for conjunctions in withfrom for t in conjunctions.elements if t.namespace == "GO"] # Filter terms that aren't GO terms
okay = len(only_go) >= 1
if len(withfrom) == 0:
okay = False
else:
for conjunctive_set in withfrom:
if conjunctive_set is None or len(conjunctive_set.elements) == 0:
okay = False
else:
only_go = [t for conjunctions in withfrom for t in conjunctions.elements if t.namespace == "GO"] # Filter terms that aren't GO terms
okay = len(only_go) >= 1

return self._result(okay)

Expand Down

0 comments on commit 718c35d

Please sign in to comment.