Skip to content

Commit 49e6036

Browse files
committed
refactor ruff
1 parent 5d11e25 commit 49e6036

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

chebi_utils/obo_extractor.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,11 @@ def build_chebi_graph(filepath: str | Path, top_class: str | None = "23367") ->
143143
def get_hierarchy_subgraph(chebi_graph: nx.DiGraph) -> nx.DiGraph:
144144
"""Subgraph of ChEBI including only edges corresponding to hierarchical relations (is_a).
145145
Also removes nodes that are not connected by any is_a edges to other nodes."""
146-
return nx.DiGraph(chebi_graph.edge_subgraph(
147-
(u, v) for u, v, d in chebi_graph.edges(data=True) if d.get("relation") == "is_a"
148-
))
146+
return nx.DiGraph(
147+
chebi_graph.edge_subgraph(
148+
(u, v) for u, v, d in chebi_graph.edges(data=True) if d.get("relation") == "is_a"
149+
)
150+
)
149151

150152

151153
if __name__ == "__main__":

0 commit comments

Comments
 (0)