Skip to content

Commit

Permalink
utils: remove read_metadata and supporting file
Browse files Browse the repository at this point in the history
Previous commits removed all references to this function, and it has been fully replaced by io.read_metadata.
  • Loading branch information
victorlin committed May 24, 2022
1 parent 99ee33f commit 040822c
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 248 deletions.
96 changes: 0 additions & 96 deletions augur/util_support/metadata_file.py

This file was deleted.

5 changes: 0 additions & 5 deletions augur/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from augur.io import open_file

from augur.util_support.color_parser import ColorParser
from augur.util_support.metadata_file import MetadataFile
from augur.util_support.node_data_reader import NodeDataReader
from augur.util_support.shell_command_runner import ShellCommandRunner

Expand Down Expand Up @@ -64,10 +63,6 @@ def get_json_name(args, default=None):
raise ValueError("Please specify a name for the JSON file containing the results.")


def read_metadata(fname, query=None, as_data_frame=False):
return MetadataFile(fname, query, as_data_frame).read()


class InvalidTreeError(Exception):
"""Represents an error loading a phylogenetic tree from a filename.
"""
Expand Down
16 changes: 0 additions & 16 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import pytest

from augur import utils
from test_filter import write_metadata

class TestUtils:
@pytest.mark.parametrize("extension", ["bed","BED"])
Expand Down Expand Up @@ -90,18 +89,3 @@ def test_read_strains(self, tmpdir):
strains = utils.read_strains(strains1, strains2)
assert len(strains) == 3
assert "strain1" in strains

def test_read_metadata(self, tmpdir):
meta_fn = write_metadata(tmpdir, (("strain","location","quality"),
("SEQ_1","colorado","good"),
("SEQ_2","colorado","bad"),
("SEQ_3","nevada","good")))
utils.read_metadata(meta_fn, as_data_frame=True)
# duplicates SEQ_1 raises ValueError
meta_fn = write_metadata(tmpdir, (("strain","location","quality"),
("SEQ_1","colorado","good"),
("SEQ_1","colorado","bad"),
("SEQ_3","nevada","good")))
with pytest.raises(ValueError) as e_info:
utils.read_metadata(meta_fn, as_data_frame=True)
assert str(e_info.value) == "Duplicated strain in metadata: SEQ_1"
131 changes: 0 additions & 131 deletions tests/util_support/test_metadata_file.py

This file was deleted.

0 comments on commit 040822c

Please sign in to comment.