Skip to content

Commit

Permalink
style: Add black to test/file_finder
Browse files Browse the repository at this point in the history
  • Loading branch information
jvfe committed Mar 30, 2024
1 parent 5893cd2 commit a8bac1e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 3 additions & 1 deletion microview/file_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ def detect_report_type(report_paths: List[Path], console) -> List[Sample]:

# TODO: Improve Kraken validation
kraken_validated = [
get_validation_dict(report, format="tsv", checks=[checks.table_dimensions(num_fields=6)])
get_validation_dict(
report, format="tsv", checks=[checks.table_dimensions(num_fields=6)]
)
for report in report_paths
]
kraken_reports = [
Expand Down
2 changes: 0 additions & 2 deletions tests/test_file_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@ def test_detect_centrifuge(get_centrifuge_data):


def test_validate_source_table(get_contrast_data):

validated = get_validation_dict(get_contrast_data, schema=contrast_table_schema)

assert validated["errors"] == 0


def test_invalidate_source_table(get_failing_contrast_data):

validated = get_validation_dict(
get_failing_contrast_data, schema=contrast_table_schema
)
Expand Down
4 changes: 0 additions & 4 deletions tests/test_parse_taxonomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,26 @@


def test_get_taxon_counts(parsed_stats):

results = get_taxon_counts(parsed_stats)

assert results["sample1"]["tax1"] == 5
assert results["sample2"]["tax2"] == 10


def test_build_taxonomy_stats(parsed_stats):

n_reads = get_read_assignment(parsed_stats)

assert n_reads["sample2"]["assigned"] == 93.75
assert n_reads["sample2"]["unassigned"] == 6.25


def test_get_common_taxas(all_sample_counts):

most_common = get_common_taxas(all_sample_counts)

assert most_common["sample2"]["tax2"] == 66.67


def test_calculate_abund_diver(all_sample_counts):

abund_div_df = calculate_abund_diver(all_sample_counts)

assert round(abund_div_df[0]["Shannon Diversity"][1], 2) == 0.92

0 comments on commit a8bac1e

Please sign in to comment.