From d08f02db16a1f37a6d7529102a50c374d71494ea Mon Sep 17 00:00:00 2001 From: Andreas Prlic Date: Sun, 1 Sep 2024 23:11:15 -0700 Subject: [PATCH] #741 small refactoring to update directory structure, based on PR comments, also disabling slow running unit test --- src/hgvs/pretty/console/chrom_seq_renderer.py | 2 +- src/hgvs/pretty/console/chrom_seq_reverse_renderer.py | 2 +- src/hgvs/pretty/console/prot_mapping_renderer.py | 2 +- src/hgvs/pretty/console/prot_seq_renderer.py | 2 +- src/hgvs/pretty/console/shuffled_variant.py | 2 +- src/hgvs/pretty/console/tx_alig_renderer.py | 2 +- src/hgvs/pretty/console/tx_ref_disagree_renderer.py | 5 ++--- src/hgvs/pretty/datacompiler.py | 1 + tests/test_pretty_print.py | 1 + 9 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/hgvs/pretty/console/chrom_seq_renderer.py b/src/hgvs/pretty/console/chrom_seq_renderer.py index 0278a682..6152d474 100644 --- a/src/hgvs/pretty/console/chrom_seq_renderer.py +++ b/src/hgvs/pretty/console/chrom_seq_renderer.py @@ -9,7 +9,7 @@ def legend(self) -> str: def display(self, data: VariantData) -> str: """colors the ref sequences with adenine (A, green), thymine (T, red), cytosine (C, yellow), and guanine (G, blue)""" - from hgvs.pretty.pretty_print import ENDC, TBLUE, TGREEN, TRED, TYELLOW + from hgvs.pretty.console.constants import ENDC, TBLUE, TGREEN, TRED, TYELLOW var_seq = "" for p in data.position_details: diff --git a/src/hgvs/pretty/console/chrom_seq_reverse_renderer.py b/src/hgvs/pretty/console/chrom_seq_reverse_renderer.py index 01effa76..22d98ffa 100644 --- a/src/hgvs/pretty/console/chrom_seq_reverse_renderer.py +++ b/src/hgvs/pretty/console/chrom_seq_reverse_renderer.py @@ -11,7 +11,7 @@ def legend(self) -> str: def display(self, data: VariantData) -> str: """colors the ref sequences with adenine (A, green), thymine (T, red), cytosine (C, yellow), and guanine (G, blue)""" - from hgvs.pretty.pretty_print import ENDC, TBLUE, TGREEN, TRED, TYELLOW + from hgvs.pretty.console.constants import ENDC, TBLUE, TGREEN, TRED, TYELLOW var_seq = "" for p in data.position_details: diff --git a/src/hgvs/pretty/console/prot_mapping_renderer.py b/src/hgvs/pretty/console/prot_mapping_renderer.py index e4ccf512..3a9b6cab 100644 --- a/src/hgvs/pretty/console/prot_mapping_renderer.py +++ b/src/hgvs/pretty/console/prot_mapping_renderer.py @@ -3,7 +3,7 @@ class ProtMappingRenderer(BasicRenderer): - """prints the position in p (amino acid) coordinates.""" + """Prints the position in p (amino acid) coordinates.""" def legend(self): return "aa pos : " diff --git a/src/hgvs/pretty/console/prot_seq_renderer.py b/src/hgvs/pretty/console/prot_seq_renderer.py index 79be30a2..7782621e 100644 --- a/src/hgvs/pretty/console/prot_seq_renderer.py +++ b/src/hgvs/pretty/console/prot_seq_renderer.py @@ -14,7 +14,7 @@ def display(self, data: VariantData) -> str: if not data.var_c_or_n: return "" - from hgvs.pretty.pretty_print import ENDC, TGREEN, TRED + from hgvs.pretty.console.constants import ENDC, TGREEN, TRED var_str = "" for pdata in data.position_details: diff --git a/src/hgvs/pretty/console/shuffled_variant.py b/src/hgvs/pretty/console/shuffled_variant.py index 5989ca9c..1bbdeebc 100644 --- a/src/hgvs/pretty/console/shuffled_variant.py +++ b/src/hgvs/pretty/console/shuffled_variant.py @@ -17,7 +17,7 @@ def legend(self) -> str: def display(self, data: VariantData) -> str: - from hgvs.pretty.pretty_print import ENDC, TBLUE, TGREEN, TRED, TYELLOW + from hgvs.pretty.console.constants import ENDC, TRED seq_start = data.display_start seq_end = data.display_end diff --git a/src/hgvs/pretty/console/tx_alig_renderer.py b/src/hgvs/pretty/console/tx_alig_renderer.py index 5afb226f..810ecf2f 100644 --- a/src/hgvs/pretty/console/tx_alig_renderer.py +++ b/src/hgvs/pretty/console/tx_alig_renderer.py @@ -17,7 +17,7 @@ def display(self, data: VariantData) -> str: if not data.var_c_or_n: return "" - from hgvs.pretty.pretty_print import ENDC, TPURPLE, TYELLOW + from hgvs.pretty.console.constants import ENDC, TPURPLE, TYELLOW var_str = "" diff --git a/src/hgvs/pretty/console/tx_ref_disagree_renderer.py b/src/hgvs/pretty/console/tx_ref_disagree_renderer.py index 1fe5177d..083939c8 100644 --- a/src/hgvs/pretty/console/tx_ref_disagree_renderer.py +++ b/src/hgvs/pretty/console/tx_ref_disagree_renderer.py @@ -6,8 +6,7 @@ class TxRefDisagreeRenderer(BasicRenderer): """Display tx-ref-disagree positions""" def legend(self) -> str: - - return f"tx ref dif: " + return "tx ref dif: " def display(self, data: VariantData) -> str: """show differences between tx and ref genome, if there are any""" @@ -15,7 +14,7 @@ def display(self, data: VariantData) -> str: if not data.var_c_or_n: return "" - from hgvs.pretty.pretty_print import ENDC, TRED + from hgvs.pretty.console.constants import ENDC, TRED var_str = "" counter = -1 diff --git a/src/hgvs/pretty/datacompiler.py b/src/hgvs/pretty/datacompiler.py index ae73fb4e..3685af11 100644 --- a/src/hgvs/pretty/datacompiler.py +++ b/src/hgvs/pretty/datacompiler.py @@ -24,6 +24,7 @@ def __init__(self, config: PrettyConfig): self.config = config def get_shuffled_variant(self, var_g: SequenceVariant, direction: int) -> VariantCoords: + """ Takes a sequence variant and returns VariantCoords that have been shuffled accordingly.""" # get shuffled representation: if direction == 5: diff --git a/tests/test_pretty_print.py b/tests/test_pretty_print.py index 0cb76f41..931b7ba5 100644 --- a/tests/test_pretty_print.py +++ b/tests/test_pretty_print.py @@ -7,6 +7,7 @@ from hgvs.pretty.pretty_print import PrettyPrint +@pytest.mark.skip("The pretty print tests are data hungry. If we were to add the data to the test cache, we would inflate the size of the cache. As such only running when necessary.") @pytest.mark.quick @pytest.mark.models class Test_SimplePosition(unittest.TestCase):