Skip to content

Commit 0b403de

Browse files
lint
1 parent b9d2959 commit 0b403de

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.github/workflows/generate_all_ontology.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Updates to Ontology Files
33
on:
44
push:
55
paths:
6-
- '**/tools/ontology-builder/ontology-references/ontology_info.yml'
6+
- "**/tools/ontology-builder/ontology-references/ontology_info.yml"
77
branches-ignore:
88
- main
99

tools/ontology-builder/all_ontology_generator.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def download(_ontology: str, _url: str) -> None:
3838
urllib.request.urlretrieve(_url, output_file)
3939
print(f"Finish Downloading {_ontology}")
4040

41-
def _build_url(_ontology: str):
41+
def _build_url(_ontology: str) -> str:
4242
onto_ref_data = ontology_info[_ontology]
4343
return f"{onto_ref_data['source']}/{onto_ref_data['version']}/{ontology.lower()}.{onto_ref_data['filetype']}"
4444

@@ -77,9 +77,10 @@ def _decompress(infile: str, tofile: str) -> None:
7777
def _load_ontology_object(onto_file: str) -> owlready2.entity.ThingClass:
7878
"""
7979
Read ontology data from file and write into a python object
80-
80+
8181
:param onto_file: filepath to ontology file
82-
:return:
82+
83+
:return: owlready2.entity.ThingClass: Ontology Term Object, with metadata parsed from ontology file
8384
"""
8485
world = owlready2.World()
8586
onto = world.get_ontology(onto_file)
@@ -110,14 +111,14 @@ def _get_ancestors(onto_class: owlready2.entity.ThingClass, onto_name: str) -> L
110111
return ancestors
111112

112113

113-
def _extract_ontology_term_metadata(onto: owlready2.entity.ThingClass) -> dict:
114+
def _extract_ontology_term_metadata(onto: owlready2.entity.ThingClass) -> Dict[str, Any]:
114115
"""
115116
Extract relevant metadata from ontology object and save into a dictionary following our JSON Schema
116117
117118
:param: onto: Ontology Object to Process
118-
:return: Dict[str, str] map of ontology term IDs to pertinent metadata from ontology files
119+
:return: Dict[str, Any] map of ontology term IDs to pertinent metadata from ontology files
119120
"""
120-
term_dict = dict()
121+
term_dict: Dict[str, Any] = dict()
121122
for onto_term in onto.classes():
122123
term_id = onto_term.name.replace("_", ":")
123124

0 commit comments

Comments
 (0)