Skip to content

Commit

Permalink
Partially removed PendingDeprecationWarning warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
eudesbarbosa committed Jun 22, 2021
1 parent 9e64d82 commit b355f78
Show file tree
Hide file tree
Showing 20 changed files with 97 additions and 96 deletions.
3 changes: 2 additions & 1 deletion snappy_pipeline/workflows/abstract/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions tests/snappy_pipeline/workflows/test_workflows_abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions tests/snappy_pipeline/workflows/test_workflows_hla_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions tests/snappy_pipeline/workflows/test_workflows_ngs_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions tests/snappy_pipeline/workflows/test_workflows_roh_calling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b355f78

Please sign in to comment.