From b355f7828b04f25ac4b2cc090ca7458fb017c4b5 Mon Sep 17 00:00:00 2001 From: Eudes Barbosa Date: Tue, 22 Jun 2021 11:10:04 +0200 Subject: [PATCH] Partially removed PendingDeprecationWarning warnings. --- snappy_pipeline/workflows/abstract/__init__.py | 3 ++- .../workflows/test_workflows_abstract.py | 10 +++++----- .../test_workflows_gene_expression_quantification.py | 10 +++++----- .../workflows/test_workflows_hla_typing.py | 10 +++++----- .../workflows/test_workflows_ngs_mapping.py | 10 +++++----- .../workflows/test_workflows_roh_calling.py | 10 +++++----- .../workflows/test_workflows_somatic_msi_calling.py | 10 +++++----- .../test_workflows_somatic_targeted_seq_cnv_calling.py | 10 +++++----- .../test_workflows_somatic_variant_calling.py | 10 +++++----- .../test_workflows_somatic_wgs_cnv_calling.py | 10 +++++----- .../test_workflows_targeted_seq_cnv_calling.py | 10 +++++----- .../workflows/test_workflows_variant_annotation.py | 10 +++++----- .../workflows/test_workflows_variant_calling.py | 10 +++++----- ...ariant_denovo_filtration_from_variant_annotation.py | 10 +++++----- ...s_variant_denovo_filtration_from_variant_calling.py | 10 +++++----- ...s_variant_denovo_filtration_from_variant_phasing.py | 10 +++++----- .../workflows/test_workflows_variant_phasing.py | 10 +++++----- .../workflows/test_workflows_wgs_cnv_calling.py | 10 +++++----- .../workflows/test_workflows_wgs_mei_calling.py | 10 +++++----- .../workflows/test_workflows_wgs_sv_calling.py | 10 +++++----- 20 files changed, 97 insertions(+), 96 deletions(-) diff --git a/snappy_pipeline/workflows/abstract/__init__.py b/snappy_pipeline/workflows/abstract/__init__.py index c1868e48..94465b9e 100644 --- a/snappy_pipeline/workflows/abstract/__init__.py +++ b/snappy_pipeline/workflows/abstract/__init__.py @@ -276,7 +276,8 @@ def _cached_read_generic_tsv_sheet(path_abs, path_rel, naming_scheme): @lru_cache() def _cached_yaml_round_trip_load_str(str_value): """Cached reading of YAML ``str`` objects.""" - return yaml.round_trip_load(StringIO(str_value)) + yaml_ = yaml.YAML() + return yaml_.load(str_value) class DataSetInfo: diff --git a/tests/snappy_pipeline/workflows/test_workflows_abstract.py b/tests/snappy_pipeline/workflows/test_workflows_abstract.py index fefbecf4..85ed93ab 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_abstract.py +++ b/tests/snappy_pipeline/workflows/test_workflows_abstract.py @@ -127,9 +127,8 @@ def test_link_in_path_generator(germline_sheet_fake_fs, config_lookup_paths, wor @pytest.fixture def dummy_config(): """Return dummy configuration OrderedDicts""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" step_config: {} static_data_config: {} data_sets: @@ -142,8 +141,9 @@ def dummy_config(): type: germline_variants naming_scheme: only_secondary_id """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture diff --git a/tests/snappy_pipeline/workflows/test_workflows_gene_expression_quantification.py b/tests/snappy_pipeline/workflows/test_workflows_gene_expression_quantification.py index 68bc8a5e..1337f9c0 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_gene_expression_quantification.py +++ b/tests/snappy_pipeline/workflows/test_workflows_gene_expression_quantification.py @@ -19,9 +19,8 @@ @pytest.fixture(scope="module") # otherwise: performance issues def minimal_config(): """Return YAML parsing result for (germline) configuration""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" static_data_config: reference: path: /path/to/ref.fa @@ -42,8 +41,9 @@ def minimal_config(): type: matched_cancer naming_scheme: only_secondary_id """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture diff --git a/tests/snappy_pipeline/workflows/test_workflows_hla_typing.py b/tests/snappy_pipeline/workflows/test_workflows_hla_typing.py index d628d56a..3a4b7111 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_hla_typing.py +++ b/tests/snappy_pipeline/workflows/test_workflows_hla_typing.py @@ -17,9 +17,8 @@ @pytest.fixture(scope="module") # otherwise: performance issues def minimal_config(): """Return YAML parsing result for (germline) configuration""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" static_data_config: reference: path: /path/to/ref.fa @@ -33,8 +32,9 @@ def minimal_config(): type: matched_cancer naming_scheme: only_secondary_id """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture diff --git a/tests/snappy_pipeline/workflows/test_workflows_ngs_mapping.py b/tests/snappy_pipeline/workflows/test_workflows_ngs_mapping.py index de50f8b0..4a04e60a 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_ngs_mapping.py +++ b/tests/snappy_pipeline/workflows/test_workflows_ngs_mapping.py @@ -22,9 +22,8 @@ @pytest.fixture(scope="module") # otherwise: performance issues def minimal_config(): """Return YAML parsing result for (germline) configuration""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" static_data_config: reference: path: /path/to/ref.fa @@ -52,8 +51,9 @@ def minimal_config(): naming_scheme: only_secondary_id pedigree_field: pedigree_field """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture diff --git a/tests/snappy_pipeline/workflows/test_workflows_roh_calling.py b/tests/snappy_pipeline/workflows/test_workflows_roh_calling.py index 66e09997..73ff2b2d 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_roh_calling.py +++ b/tests/snappy_pipeline/workflows/test_workflows_roh_calling.py @@ -18,9 +18,8 @@ @pytest.fixture(scope="module") # otherwise: performance issues def minimal_config(): """Return YAML parsing result for (germline) configuration""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" static_data_config: reference: path: /path/to/ref.fa @@ -51,8 +50,9 @@ def minimal_config(): type: germline_variants naming_scheme: only_secondary_id """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture diff --git a/tests/snappy_pipeline/workflows/test_workflows_somatic_msi_calling.py b/tests/snappy_pipeline/workflows/test_workflows_somatic_msi_calling.py index 795b5475..44e319d2 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_somatic_msi_calling.py +++ b/tests/snappy_pipeline/workflows/test_workflows_somatic_msi_calling.py @@ -17,9 +17,8 @@ @pytest.fixture(scope="module") # otherwise: performance issues def minimal_config(): """Return YAML parsing result for configuration""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" static_data_config: reference: path: /path/to/ref.fa @@ -44,8 +43,9 @@ def minimal_config(): type: matched_cancer naming_scheme: only_secondary_id """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture diff --git a/tests/snappy_pipeline/workflows/test_workflows_somatic_targeted_seq_cnv_calling.py b/tests/snappy_pipeline/workflows/test_workflows_somatic_targeted_seq_cnv_calling.py index d20d406a..9eb31f40 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_somatic_targeted_seq_cnv_calling.py +++ b/tests/snappy_pipeline/workflows/test_workflows_somatic_targeted_seq_cnv_calling.py @@ -22,9 +22,8 @@ @pytest.fixture(scope="module") # otherwise: performance issues def minimal_config(): """Return YAML parsing result for (somatic) configuration""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" static_data_config: reference: path: /path/to/ref.fa @@ -55,8 +54,9 @@ def minimal_config(): type: matched_cancer naming_scheme: only_secondary_id """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture diff --git a/tests/snappy_pipeline/workflows/test_workflows_somatic_variant_calling.py b/tests/snappy_pipeline/workflows/test_workflows_somatic_variant_calling.py index dd5dacba..c3634dc8 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_somatic_variant_calling.py +++ b/tests/snappy_pipeline/workflows/test_workflows_somatic_variant_calling.py @@ -18,9 +18,8 @@ @pytest.fixture(scope="module") # otherwise: performance issues def minimal_config(): """Return YAML parsing result for (germline) configuration""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" static_data_config: reference: path: /path/to/ref.fa @@ -54,8 +53,9 @@ def minimal_config(): type: matched_cancer naming_scheme: only_secondary_id """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture diff --git a/tests/snappy_pipeline/workflows/test_workflows_somatic_wgs_cnv_calling.py b/tests/snappy_pipeline/workflows/test_workflows_somatic_wgs_cnv_calling.py index e1155b0d..eb6d5ba8 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_somatic_wgs_cnv_calling.py +++ b/tests/snappy_pipeline/workflows/test_workflows_somatic_wgs_cnv_calling.py @@ -19,9 +19,8 @@ @pytest.fixture(scope="module") # otherwise: performance issues def minimal_config(): """Return YAML parsing result for (somatic) configuration""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" static_data_config: reference: path: /path/to/ref.fa @@ -60,8 +59,9 @@ def minimal_config(): type: matched_cancer naming_scheme: only_secondary_id """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture diff --git a/tests/snappy_pipeline/workflows/test_workflows_targeted_seq_cnv_calling.py b/tests/snappy_pipeline/workflows/test_workflows_targeted_seq_cnv_calling.py index 4e18731b..793b2d9c 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_targeted_seq_cnv_calling.py +++ b/tests/snappy_pipeline/workflows/test_workflows_targeted_seq_cnv_calling.py @@ -78,9 +78,8 @@ def get_expected_gcnv_log_file(step_name): @pytest.fixture(scope="module") # otherwise: performance issues def minimal_config(): """Return YAML parsing result for (somatic) configuration""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" static_data_config: reference: path: /path/to/ref.fa @@ -121,8 +120,9 @@ def minimal_config(): type: germline_variants naming_scheme: only_secondary_id """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture diff --git a/tests/snappy_pipeline/workflows/test_workflows_variant_annotation.py b/tests/snappy_pipeline/workflows/test_workflows_variant_annotation.py index 982e06e8..ec7c0a73 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_variant_annotation.py +++ b/tests/snappy_pipeline/workflows/test_workflows_variant_annotation.py @@ -17,9 +17,8 @@ @pytest.fixture(scope="module") # otherwise: performance issues def minimal_config(): """Return YAML parsing result for (germline) configuration""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" static_data_config: reference: path: /path/to/ref.fa @@ -48,8 +47,9 @@ def minimal_config(): type: germline_variants naming_scheme: only_secondary_id """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture diff --git a/tests/snappy_pipeline/workflows/test_workflows_variant_calling.py b/tests/snappy_pipeline/workflows/test_workflows_variant_calling.py index 08fccd39..9bf9d4f3 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_variant_calling.py +++ b/tests/snappy_pipeline/workflows/test_workflows_variant_calling.py @@ -19,9 +19,8 @@ @pytest.fixture(scope="module") # otherwise: performance issues def minimal_config(): """Return YAML parsing result for (germline) configuration""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" static_data_config: reference: path: /path/to/ref.fa @@ -55,8 +54,9 @@ def minimal_config(): type: germline_variants naming_scheme: only_secondary_id """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture diff --git a/tests/snappy_pipeline/workflows/test_workflows_variant_denovo_filtration_from_variant_annotation.py b/tests/snappy_pipeline/workflows/test_workflows_variant_denovo_filtration_from_variant_annotation.py index 9b409435..02ee00ff 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_variant_denovo_filtration_from_variant_annotation.py +++ b/tests/snappy_pipeline/workflows/test_workflows_variant_denovo_filtration_from_variant_annotation.py @@ -19,9 +19,8 @@ @pytest.fixture(scope="module") # otherwise: performance issues def minimal_config(): """Return YAML parsing result for (germline) configuration""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" static_data_config: reference: path: /path/to/ref.fa @@ -52,8 +51,9 @@ def minimal_config(): type: germline_variants naming_scheme: only_secondary_id """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture diff --git a/tests/snappy_pipeline/workflows/test_workflows_variant_denovo_filtration_from_variant_calling.py b/tests/snappy_pipeline/workflows/test_workflows_variant_denovo_filtration_from_variant_calling.py index b6525450..f304a0b9 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_variant_denovo_filtration_from_variant_calling.py +++ b/tests/snappy_pipeline/workflows/test_workflows_variant_denovo_filtration_from_variant_calling.py @@ -19,9 +19,8 @@ @pytest.fixture(scope="module") # otherwise: performance issues def minimal_config(): """Return YAML parsing result for (germline) configuration""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" static_data_config: reference: path: /path/to/ref.fa @@ -52,8 +51,9 @@ def minimal_config(): type: germline_variants naming_scheme: only_secondary_id """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture diff --git a/tests/snappy_pipeline/workflows/test_workflows_variant_denovo_filtration_from_variant_phasing.py b/tests/snappy_pipeline/workflows/test_workflows_variant_denovo_filtration_from_variant_phasing.py index 914c326c..33724cb8 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_variant_denovo_filtration_from_variant_phasing.py +++ b/tests/snappy_pipeline/workflows/test_workflows_variant_denovo_filtration_from_variant_phasing.py @@ -19,9 +19,8 @@ @pytest.fixture(scope="module") # otherwise: performance issues def minimal_config(): """Return YAML parsing result for (germline) configuration""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" static_data_config: reference: path: /path/to/ref.fa @@ -52,8 +51,9 @@ def minimal_config(): type: germline_variants naming_scheme: only_secondary_id """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture diff --git a/tests/snappy_pipeline/workflows/test_workflows_variant_phasing.py b/tests/snappy_pipeline/workflows/test_workflows_variant_phasing.py index b93e96f0..7563478a 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_variant_phasing.py +++ b/tests/snappy_pipeline/workflows/test_workflows_variant_phasing.py @@ -19,9 +19,8 @@ @pytest.fixture(scope="module") # otherwise: performance issues def minimal_config(): """Return YAML parsing result for (germline) configuration""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" static_data_config: reference: path: /path/to/ref.fa @@ -59,8 +58,9 @@ def minimal_config(): type: germline_variants naming_scheme: only_secondary_id """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture diff --git a/tests/snappy_pipeline/workflows/test_workflows_wgs_cnv_calling.py b/tests/snappy_pipeline/workflows/test_workflows_wgs_cnv_calling.py index d70d9150..dcbbf979 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_wgs_cnv_calling.py +++ b/tests/snappy_pipeline/workflows/test_workflows_wgs_cnv_calling.py @@ -19,9 +19,8 @@ @pytest.fixture(scope="module") # otherwise: performance issues def minimal_config(): """Return YAML parsing result for (germline) configuration""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" static_data_config: reference: path: /path/to/ref.fa @@ -54,8 +53,9 @@ def minimal_config(): type: germline_variants naming_scheme: only_secondary_id """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture diff --git a/tests/snappy_pipeline/workflows/test_workflows_wgs_mei_calling.py b/tests/snappy_pipeline/workflows/test_workflows_wgs_mei_calling.py index bf234ba6..d6e791dc 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_wgs_mei_calling.py +++ b/tests/snappy_pipeline/workflows/test_workflows_wgs_mei_calling.py @@ -19,9 +19,8 @@ @pytest.fixture(scope="module") # otherwise: performance issues def minimal_config(): """Return YAML parsing result for (somatic) configuration""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" static_data_config: reference: path: /path/to/ref.fa @@ -53,8 +52,9 @@ def minimal_config(): type: germline_variants naming_scheme: only_secondary_id """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture diff --git a/tests/snappy_pipeline/workflows/test_workflows_wgs_sv_calling.py b/tests/snappy_pipeline/workflows/test_workflows_wgs_sv_calling.py index 93b769fa..3443eff5 100644 --- a/tests/snappy_pipeline/workflows/test_workflows_wgs_sv_calling.py +++ b/tests/snappy_pipeline/workflows/test_workflows_wgs_sv_calling.py @@ -18,9 +18,8 @@ @pytest.fixture(scope="module") # otherwise: performance issues def minimal_config(): """Return YAML parsing result for (somatic) configuration""" - return yaml.round_trip_load( - textwrap.dedent( - r""" + config_str = textwrap.dedent( + r""" static_data_config: reference: path: /path/to/ref.fa @@ -53,8 +52,9 @@ def minimal_config(): type: germline_variants naming_scheme: only_secondary_id """ - ).lstrip() - ) + ).lstrip() + yaml_ = yaml.YAML() + return yaml_.load(config_str) @pytest.fixture