Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
amc-corey-cox committed Nov 7, 2024
1 parent 017f7a9 commit 6c87e0f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
13 changes: 9 additions & 4 deletions src/koza/io/writer/jsonl_writer.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import json
import os
from typing import Iterable, List, Optional
from typing import List, Optional

from koza.converter.kgx_converter import KGXConverter
from koza.io.writer.writer import KozaWriter
from koza.model.config.sssom_config import SSSOMConfig


class JSONLWriter(KozaWriter):
def __init__(self, output_dir: str, source_name: str, node_properties: List[str],
edge_properties: Optional[List[str]] = None, sssom_config: SSSOMConfig = None):
def __init__(
self,
output_dir: str,
source_name: str,
node_properties: List[str],
edge_properties: Optional[List[str]] = None,
sssom_config: SSSOMConfig = None,
):
super().__init__(output_dir, source_name, node_properties, edge_properties, sssom_config)

os.makedirs(output_dir, exist_ok=True)
Expand Down
2 changes: 1 addition & 1 deletion src/koza/io/writer/tsv_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# NOTE - May want to rename to KGXWriter at some point, if we develop writers for other models non biolink/kgx specific

from pathlib import Path
from typing import Dict, Iterable, List, Literal, Set, Tuple, Union
from typing import Dict, List, Literal, Set, Tuple, Union

from numpy.f2py.auxfuncs import throw_error
from ordered_set import OrderedSet
Expand Down
1 change: 1 addition & 0 deletions src/koza/io/writer/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class KozaWriter(ABC):
"""
An abstract base class for all koza writers
"""

def __init__(
self,
output_dir: Union[str, Path],
Expand Down
9 changes: 5 additions & 4 deletions tests/unit/test_tsvwriter_node_and_edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def test_tsv_writer():
'deprecated',
'has_attribute',
'full_name',
'iri', 'name',
'iri',
'name',
]
edge_properties = [
"id",
Expand Down Expand Up @@ -90,7 +91,7 @@ def test_tsv_writer():
'primary_knowledge_source',
'object_aspect_qualifier',
'object_closure',
'subject_aspect_qualifier'
'subject_aspect_qualifier',
]

outdir = "output/tests"
Expand All @@ -115,7 +116,7 @@ def test_tsv_writer():
lines = f.readlines()
assert (
lines[1].strip()
== "uuid:5b06e86f-d768-4cd9-ac27-abe31e95ab1e\tHGNC:11603\tbiolink:contributes_to\tMONDO:0005002\t" +
"biolink:GeneToDiseaseAssociation\t\tnot_provided\t\t\t\t\t\t\t0\t\t\t\t20\t\tnot_provided"
== "uuid:5b06e86f-d768-4cd9-ac27-abe31e95ab1e\tHGNC:11603\tbiolink:contributes_to\tMONDO:0005002\t"
+ "biolink:GeneToDiseaseAssociation\t\tnot_provided\t\t\t\t\t\t\t0\t\t\t\t20\t\tnot_provided"
)
assert len(lines) == 2
2 changes: 1 addition & 1 deletion tests/unit/test_tsvwriter_node_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_tsv_writer():
'deprecated',
'full_name',
'name',
'has_attribute'
'has_attribute',
]

outdir = "output/tests"
Expand Down

0 comments on commit 6c87e0f

Please sign in to comment.