Skip to content

Commit

Permalink
lint - remove unused imports. black --line-len 100 -C
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinbleile committed Jul 19, 2024
1 parent 9c1e70c commit e27e2d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 41 deletions.
24 changes: 5 additions & 19 deletions pori_python/ipr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,7 @@ def command_interface() -> None:
parser.add_argument("--graphkb_url", default=None)
parser.add_argument("--log_level", default="info", choices=LOG_LEVELS.keys())
parser.add_argument(
"--therapeutics",
default=False,
help="Generate therapeutic options",
action="store_true",
"--therapeutics", default=False, help="Generate therapeutic options", action="store_true"
)
parser.add_argument(
"--skip_comments",
Expand All @@ -86,9 +83,7 @@ def command_interface() -> None:
help="Turn off generating the analyst comments section of the report",
)
parser.add_argument(
"-o",
"--output_json_path",
help="path to a JSON to output the report upload body",
"-o", "--output_json_path", help="path to a JSON to output the report upload body"
)
parser.add_argument(
"-w",
Expand Down Expand Up @@ -370,10 +365,7 @@ def ipr_report(
logger.info(f"annotating {len(structural_variants)} structural variants")
gkb_matches.extend(
annotate_positional_variants(
graphkb_conn,
structural_variants,
kb_disease_match,
show_progress=interactive,
graphkb_conn, structural_variants, kb_disease_match, show_progress=interactive
)
)
logger.debug(f"\tgkb_matches: {len(gkb_matches)}")
Expand All @@ -389,10 +381,7 @@ def ipr_report(
logger.info(f"annotating {len(expression_variants)} expression variants")
gkb_matches.extend(
annotate_expression_variants(
graphkb_conn,
expression_variants,
kb_disease_match,
show_progress=interactive,
graphkb_conn, expression_variants, kb_disease_match, show_progress=interactive
)
)
logger.debug(f"\tgkb_matches: {len(gkb_matches)}")
Expand Down Expand Up @@ -429,10 +418,7 @@ def ipr_report(
if generate_comments:
comments = {
"comments": summarize(
graphkb_conn,
gkb_matches,
disease_name=kb_disease_match,
variants=all_variants,
graphkb_conn, gkb_matches, disease_name=kb_disease_match, variants=all_variants
)
}
else:
Expand Down
28 changes: 6 additions & 22 deletions tests/test_ipr/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import pytest
import sys
import uuid
from typing import Dict, Tuple
from unittest.mock import MagicMock, patch
from typing import Dict
from unittest.mock import patch

from pori_python.ipr.connection import IprConnection
from pori_python.ipr.main import command_interface
Expand Down Expand Up @@ -41,10 +41,7 @@ def loaded_reports(tmp_path_factory) -> Dict:
{"analysisRole": "expression (disease)", "name": "1"},
{"analysisRole": "expression (primary site)", "name": "2"},
{"analysisRole": "expression (biopsy site)", "name": "3"},
{
"analysisRole": "expression (internal pancancer cohort)",
"name": "4",
},
{"analysisRole": "expression (internal pancancer cohort)", "name": "4"},
],
"patientId": patient_id,
"project": "TEST",
Expand All @@ -66,20 +63,10 @@ def loaded_reports(tmp_path_factory) -> Dict:
),
"kbDiseaseMatch": "colorectal cancer",
}
json_file.write_text(
json.dumps(
json_contents,
allow_nan=False,
)
)
json_file.write_text(json.dumps(json_contents, allow_nan=False))

json_contents["patientId"] = async_patient_id
async_json_file.write_text(
json.dumps(
json_contents,
allow_nan=False,
)
)
async_json_file.write_text(json.dumps(json_contents, allow_nan=False))

argslist = [
"ipr",
Expand Down Expand Up @@ -114,10 +101,7 @@ def loaded_reports(tmp_path_factory) -> Dict:
loaded_report = ipr_conn.get(uri=f"reports?searchText={patient_id}")
async_loaded_report = ipr_conn.get(uri=f"reports?searchText={async_patient_id}")

return {
"sync": (patient_id, loaded_report),
"async": (async_patient_id, async_loaded_report),
}
return {"sync": (patient_id, loaded_report), "async": (async_patient_id, async_loaded_report)}


def get_section(loaded_report, section_name):
Expand Down

0 comments on commit e27e2d5

Please sign in to comment.