From 6c87e0fde72d16f6bb1dc7c191b8bd5c5bfa3c6f Mon Sep 17 00:00:00 2001 From: amc-corey-cox <69321580+amc-corey-cox@users.noreply.github.com> Date: Thu, 7 Nov 2024 14:43:01 -0600 Subject: [PATCH] Fix linting --- src/koza/io/writer/jsonl_writer.py | 13 +++++++++---- src/koza/io/writer/tsv_writer.py | 2 +- src/koza/io/writer/writer.py | 1 + tests/unit/test_tsvwriter_node_and_edge.py | 9 +++++---- tests/unit/test_tsvwriter_node_only.py | 2 +- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/koza/io/writer/jsonl_writer.py b/src/koza/io/writer/jsonl_writer.py index 71add14..9d1aa8b 100644 --- a/src/koza/io/writer/jsonl_writer.py +++ b/src/koza/io/writer/jsonl_writer.py @@ -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) diff --git a/src/koza/io/writer/tsv_writer.py b/src/koza/io/writer/tsv_writer.py index 5d266f5..45019d3 100644 --- a/src/koza/io/writer/tsv_writer.py +++ b/src/koza/io/writer/tsv_writer.py @@ -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 diff --git a/src/koza/io/writer/writer.py b/src/koza/io/writer/writer.py index b965930..abd638f 100644 --- a/src/koza/io/writer/writer.py +++ b/src/koza/io/writer/writer.py @@ -11,6 +11,7 @@ class KozaWriter(ABC): """ An abstract base class for all koza writers """ + def __init__( self, output_dir: Union[str, Path], diff --git a/tests/unit/test_tsvwriter_node_and_edge.py b/tests/unit/test_tsvwriter_node_and_edge.py index 70be079..2454d47 100644 --- a/tests/unit/test_tsvwriter_node_and_edge.py +++ b/tests/unit/test_tsvwriter_node_and_edge.py @@ -39,7 +39,8 @@ def test_tsv_writer(): 'deprecated', 'has_attribute', 'full_name', - 'iri', 'name', + 'iri', + 'name', ] edge_properties = [ "id", @@ -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" @@ -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 diff --git a/tests/unit/test_tsvwriter_node_only.py b/tests/unit/test_tsvwriter_node_only.py index cc40123..ce9849e 100644 --- a/tests/unit/test_tsvwriter_node_only.py +++ b/tests/unit/test_tsvwriter_node_only.py @@ -31,7 +31,7 @@ def test_tsv_writer(): 'deprecated', 'full_name', 'name', - 'has_attribute' + 'has_attribute', ] outdir = "output/tests"