Skip to content

Commit

Permalink
Minor clean up (#178)
Browse files Browse the repository at this point in the history
Remove pylint configs and update code base.
Remove all TODO and XXX comments in favor of dedicated issues on GitHub.

Keep mypy at v1.4.1 to support Python 3.7.
Add comments about pre-commit hook versions.

Remove unnecessary future import.
  • Loading branch information
CasperWA authored Oct 30, 2023
1 parent ceade27 commit f2bb550
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 666 deletions.
2 changes: 1 addition & 1 deletion .github/static/get_dic2owl_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def main(argv_input: list = None) -> Set[str]:
for file in args.requirements_files:
if not file.exists():
raise FileNotFoundError(f"Could not find {file} !")
with open(file.resolve(), "r") as handle:
with open(file.resolve(), "r", encoding="utf8") as handle:
for line in handle.readlines():
match = requirements_regex.fullmatch(line)
if match is None:
Expand Down
13 changes: 1 addition & 12 deletions dic2owl/dic2owl/dic2owl.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ class Generator:
"ontology/cif-ddl.ttl"
)

# TODO:
# Should `comments` be replaced with a dict `annotations` for annotating
# the ontology itself? If so, we should import Dublin Core.

def __init__(
self,
dicfile: "StrPath",
Expand Down Expand Up @@ -187,10 +183,8 @@ def _add_data_value(self, item: dict) -> None:
for ddl_name, value in item.items():
if ddl_name.startswith("_type."):
if ddl_name == "_type.dimension":
# TODO - fix special case
pass
elif value == "Implied":
# TODO - fix special case
pass
else:
parents.append(self.ddl[value])
Expand Down Expand Up @@ -221,11 +215,6 @@ class `cls`.

def _add_metadata(self) -> None:
"""Adds metadata to the generated ontology."""
# TODO:
# Is there a way to extract metadata from the dic object like
# _dictionary_audit.version?
# onto.set_version(version="XXX")

for comment in self.comments:
self.onto.metadata.comment.append(comment)
self.onto.metadata.comment.append(
Expand Down Expand Up @@ -275,4 +264,4 @@ def main(
overwrite=True,
)

return gen # XXX - just for debugging
return gen
Loading

0 comments on commit f2bb550

Please sign in to comment.