Skip to content

Commit 57f97f9

Browse files
committed
minor lint - isort inputs & quotes
1 parent e05ec5b commit 57f97f9

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

pori_python/ipr/ipr.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,10 @@ def create_key_alterations(
295295
counts: Dict[str, Set] = {v: set() for v in type_mapping.values()}
296296
skipped_variant_types = []
297297

298-
included_kbvariant_ids = list(set([item['kbVariantId'] for item in included_kb_matches]))
298+
included_kbvariant_ids = list(set([item["kbVariantId"] for item in included_kb_matches]))
299299

300300
for kb_match in kb_matches:
301-
if kb_match['kbVariantId'] not in included_kbvariant_ids:
301+
if kb_match["kbVariantId"] not in included_kbvariant_ids:
302302
continue
303303
variant_type = kb_match["variantType"]
304304
variant_key = kb_match["variant"]
@@ -646,13 +646,13 @@ def get_kb_matches_sections(
646646
unique_kb_variant_ids = list(
647647
set(
648648
[
649-
item['kbVariantId']
649+
item["kbVariantId"]
650650
for conditionSet in kb_statement_matched_conditions
651-
for item in conditionSet['matchedConditions']
651+
for item in conditionSet["matchedConditions"]
652652
]
653653
)
654654
)
655-
kb_variants = [item for item in kb_variants if item['kbVariantId'] in unique_kb_variant_ids]
655+
kb_variants = [item for item in kb_variants if item["kbVariantId"] in unique_kb_variant_ids]
656656

657657
return {
658658
"kbMatches": kb_variants,

pori_python/ipr/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ def ipr_report(
525525

526526
# KEY ALTERATIONS
527527
key_alterations, variant_counts = create_key_alterations(
528-
gkb_matches, all_variants, kb_matched_sections['kbMatches']
528+
gkb_matches, all_variants, kb_matched_sections["kbMatches"]
529529
)
530530

531531
# OUTPUT CONTENT

tests/test_ipr/test_ipr.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
from pori_python.graphkb import vocab as gkb_vocab
66
from pori_python.ipr.ipr import (
77
convert_statements_to_alterations,
8+
create_key_alterations,
89
germline_kb_matches,
910
get_kb_disease_matches,
1011
get_kb_matched_statements,
12+
get_kb_matches_sections,
1113
get_kb_statement_matched_conditions,
1214
get_kb_variants,
13-
get_kb_matches_sections,
14-
create_key_alterations,
1515
)
1616
from pori_python.types import Statement
1717

@@ -497,10 +497,10 @@ def test_germline_kb_matches(self):
497497
]
498498

499499
ALL_VARIANTS = [
500-
{"variant": "var1", "key": '1', "variantType": 'mut'},
501-
{"variant": "var2", "key": '2', "variantType": 'mut'},
502-
{"variant": "var3", "key": '3', "variantType": 'mut'},
503-
{"variant": "var4", "key": '4', "variantType": 'mut'},
500+
{"variant": "var1", "key": "1", "variantType": "mut"},
501+
{"variant": "var2", "key": "2", "variantType": "mut"},
502+
{"variant": "var3", "key": "3", "variantType": "mut"},
503+
{"variant": "var4", "key": "4", "variantType": "mut"},
504504
]
505505

506506
BASIC_GKB_MATCH = {
@@ -709,8 +709,8 @@ def test_partial_matches_omitted(self):
709709
gkb_matches = create_gkb_matches(input_fields)
710710
sections = get_kb_matches_sections(gkb_matches, allow_partial_matches=False)
711711

712-
stmts = sections['kbMatchedStatements']
713-
kbcs = sections['kbStatementMatchedConditions']
712+
stmts = sections["kbMatchedStatements"]
713+
kbcs = sections["kbStatementMatchedConditions"]
714714
assert len(stmts) == 2
715715
assert len(kbcs) == 1 # X only
716716
assert kbcs[0]["kbStatementId"] == "X"
@@ -796,14 +796,14 @@ def test_kbvariants_removed_from_set_when_not_part_of_full_conditionset_match(se
796796
item["kbVariant"] = "test"
797797
gkb_matches = create_gkb_matches(input_fields)
798798
sections1 = get_kb_matches_sections(gkb_matches, allow_partial_matches=False)
799-
kbcs1 = sections1['kbStatementMatchedConditions']
800-
kbvars1 = sections1['kbMatches']
799+
kbcs1 = sections1["kbStatementMatchedConditions"]
800+
kbvars1 = sections1["kbMatches"]
801801
assert len(kbcs1) == 1 # only fully matched condition sets included
802802
assert len(kbvars1) == 2 # therefore, kbvars associated with stmt X are pruned
803803

804804
sections2 = get_kb_matches_sections(gkb_matches, allow_partial_matches=True)
805-
kbcs2 = sections2['kbStatementMatchedConditions']
806-
kbvars2 = sections2['kbMatches']
805+
kbcs2 = sections2["kbStatementMatchedConditions"]
806+
kbvars2 = sections2["kbMatches"]
807807
assert len(kbcs2) == 2 # all condition sets included
808808
assert len(kbvars2) == 3 # therefore, no pruning
809809

@@ -844,12 +844,12 @@ def test_create_key_alterations_includes_only_pruned_kbmatches(self):
844844

845845
sections1 = get_kb_matches_sections(gkb_matches, allow_partial_matches=False)
846846
key_alts1, counts1 = create_key_alterations(
847-
gkb_matches, ALL_VARIANTS, sections1['kbMatches']
847+
gkb_matches, ALL_VARIANTS, sections1["kbMatches"]
848848
)
849849

850850
sections2 = get_kb_matches_sections(gkb_matches, allow_partial_matches=True)
851851
key_alts2, counts2 = create_key_alterations(
852-
gkb_matches, ALL_VARIANTS, sections2['kbMatches']
852+
gkb_matches, ALL_VARIANTS, sections2["kbMatches"]
853853
)
854854

855855
# check partial-match-only variants are not included in key alterations when

0 commit comments

Comments
 (0)