Skip to content

Commit c49bdb9

Browse files
chores: comment all the look&feel (possible client interface) using line comments rather a big docstring. It removes errors when the linter runs.
1 parent ef656f9 commit c49bdb9

1 file changed

Lines changed: 32 additions & 66 deletions

File tree

ontograph/core.py

Lines changed: 32 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,71 @@
1-
from dataclasses import dataclass
2-
from pronto import Ontology
3-
41
# Import the logic to deal with OBO Foundry registry (Implementation)
5-
from ontology_registry import OBORegistryAdapter
6-
72
# Import the logic to download files (Implementation)
83
from downloader import PoochDownloaderAdapter
4+
from ontology_registry import OBORegistryAdapter
95

106
# Import the logic to load ontologies (Implementation)
11-
from ontology_loader import ProntoLoaderAdapter
127

138

14-
cache_dir = "../data/out"
9+
cache_dir = '../data/out'
1510

1611
ontologies_registry = OBORegistryAdapter(cache_dir=cache_dir)
1712

18-
downloader = PoochDownloaderAdapter(cache_dir=cache_dir, registry=ontologies_registry)
19-
20-
21-
class Ontology:
22-
def __init__(self):
23-
pass
24-
25-
26-
class Registry:
27-
def __init__(self):
28-
pass
29-
30-
31-
class Client:
32-
def __init__(self):
33-
self.__registry # This one needs to be instantiated Just one time (singleton?)
34-
self.__ontology # This one can be instantiated multiple times
35-
36-
# methods for manipulating the registry
37-
def __initialize_registry():
38-
pass
39-
40-
# methods for manipulating the ontology
41-
def __initialize_ontology():
42-
pass
43-
44-
45-
# 1.
46-
"""
47-
48-
import ontograph as op
49-
13+
downloader = PoochDownloaderAdapter(
14+
cache_dir=cache_dir, registry=ontologies_registry
15+
)
5016

51-
onto_registry = op.registry()
5217

53-
onto_registry.list_ontologies()
18+
# import ontograph as op
5419

55-
onto_registry.load_registry()
5620

57-
onto_registry.registry()
21+
# onto_registry = op.registry()
5822

59-
onto_registry.list_available_ontologies()
23+
# onto_registry.list_ontologies()
6024

61-
onto_registry.print_registry_schema_tree()
25+
# onto_registry.load_registry()
6226

63-
onto_registry.get_ontology_metadata()
27+
# onto_registry.registry()
6428

65-
onto_registry.get_download_url()
29+
# onto_registry.list_available_ontologies()
6630

67-
onto_registry.get_available_formats()
31+
# onto_registry.print_registry_schema_tree()
6832

33+
# onto_registry.get_ontology_metadata()
6934

35+
# onto_registry.get_download_url()
7036

71-
# Similar to Pandas Dataframe Look & Feel
72-
go = op.load(path: str, name_id: str, format: str = "obo")
37+
# onto_registry.get_available_formats()
7338

74-
go.get_parents(term_id: str, depth: int = -1, include_self: bool = False)
7539

76-
go.get_children(term_id: str, depth: int = -1, include_self: bool = False)
40+
# # Similar to Pandas Dataframe Look & Feel
41+
# go = op.load(path: str, name_id: str, format: str = "obo")
7742

78-
go.get_siblings(term_id)
43+
# go.get_parents(term_id: str, depth: int = -1, include_self: bool = False)
7944

80-
go.get_roots()
45+
# go.get_children(term_id: str, depth: int = -1, include_self: bool = False)
8146

82-
go.get_leaves()
47+
# go.get_siblings(term_id)
8348

84-
go.find_path(source_id, target_id)
49+
# go.get_roots()
8550

86-
go.is_descendant(child_id, parent_id)
51+
# go.get_leaves()
8752

88-
go.get_depth(term_id)
53+
# go.find_path(source_id, target_id)
8954

90-
go.list_terms(prefix="GO:", include_obsolete=False)
55+
# go.is_descendant(child_id, parent_id)
9156

92-
go.get_term_info(term_id)
57+
# go.get_depth(term_id)
9358

94-
go.search_terms(query="metabolic process", exact=False)
59+
# go.list_terms(prefix="GO:", include_obsolete=False)
9560

96-
go.get_relationships(term_id)
61+
# go.get_term_info(term_id)
9762

98-
go.get_terms_by_relation(terms="part_of")
63+
# go.search_terms(query="metabolic process", exact=False)
9964

100-
go.get_common_ancestors(term_ids)
65+
# go.get_relationships(term_id)
10166

102-
go.term_exists(term_id)
67+
# go.get_terms_by_relation(terms="part_of")
10368

69+
# go.get_common_ancestors(term_ids)
10470

105-
"""
71+
# go.term_exists(term_id)

0 commit comments

Comments
 (0)