Closed patrickkwang closed 2 years ago
Currently, providing an unrecognized element name to e.g. get_descendants() returns an empty list. This is also the behavior when there are simply no descendants (with reflexive=False).
get_descendants()
reflexive=False
>>> tk.get_descendants("biolink:invalid", reflexive=False) [] >>> tk.get_descendants("biolink:disease", reflexive=False) []
I think it would be more natural to raise a ValueError in the first case.
ValueError
Another interesting case:
>>> tk.get_descendants("biolink:invalid", reflexive=True) []
Currently, providing an unrecognized element name to e.g.
get_descendants()
returns an empty list. This is also the behavior when there are simply no descendants (withreflexive=False
).I think it would be more natural to raise a
ValueError
in the first case.