Skip to content

Commit 39e22ec

Browse files
Copilotsfluegel05
andcommitted
Fix ruff formatting in obo_extractor.py and test_obo_extractor.py
Co-authored-by: sfluegel05 <43573433+sfluegel05@users.noreply.github.com>
1 parent ab26a27 commit 39e22ec

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

chebi_utils/obo_extractor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ def build_chebi_graph(filepath: str | Path) -> nx.DiGraph:
115115

116116
return graph
117117

118+
118119
def get_hierarchy_subgraph(chebi_graph: nx.DiGraph) -> nx.DiGraph:
119120
"""Subgraph of ChEBI including only edges corresponding to hierarchical relations (is_a). Also removes nodes that are not connected by any is_a edges to other nodes."""
120121
return chebi_graph.edge_subgraph(

tests/test_obo_extractor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ def test_node_name_attribute(self):
4141

4242
def test_smiles_extracted_from_property_value(self):
4343
g = build_chebi_graph(SAMPLE_OBO)
44-
expected = "COc1cc2c3cc1Oc1c(O)c(OC)cc4c1[C@H](Cc1ccc(O)c(c1)Oc1ccc(cc1)C[C@@H]3N(C)CC2)N(C)CC4"
44+
expected = (
45+
"COc1cc2c3cc1Oc1c(O)c(OC)cc4c1[C@H](Cc1ccc(O)c(c1)Oc1ccc(cc1)C[C@@H]3N(C)CC2)N(C)CC4"
46+
)
4547
assert g.nodes["10"]["smiles"] == expected
4648

4749
def test_smiles_none_when_absent(self):

0 commit comments

Comments
 (0)