Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonkoehn committed Oct 25, 2024
1 parent 9185d5b commit 3760a09
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 203 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ matplotlib = "^3.9.2"
seaborn = "^0.13.2"
pandas-stubs = "^2.2.2.240807"
click = "^8.1.7"
snakemake = "^8.20.4"
# Pinned as later snakemake version fail to unit test generation
snakemake = "8.18.1"

[tool.poetry.group.dev.dependencies]
pytest = "^7.2.1"
Expand Down
27 changes: 1 addition & 26 deletions workflow/.tests/unit/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,8 @@
import csv
import math

import pandas as pd


def compare_csv_files(
file1_path: str, file2_path: str, tolerance: float = 1e-4
) -> bool:
"""
Compare two CSV files with a given tolerance.
"""
df1 = pd.read_csv(file1_path, skiprows=[1])
df2 = pd.read_csv(file2_path, skiprows=[1])

if df1.shape != df2.shape:
raise ValueError("DataFrames have different shapes")

# check that the data frames contrain the same data types
assert df1.dtypes.equals(df2.dtypes)

# check that the data frames contain the same data
pd.testing.assert_frame_equal(
df1, df2, check_exact=False, rtol=tolerance, atol=tolerance
)

return True


class OutputCheckerV2:
class OutputChecker:
"""
Check the output of a Snakemake rule given only the directories
of the input data, expected output, and the working directory and
Expand Down
4 changes: 2 additions & 2 deletions workflow/.tests/unit/test_amplicon_cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import shutil
from pathlib import Path

from common import OutputCheckerV2
from common import OutputChecker


def print_directory_contents(path):
Expand Down Expand Up @@ -85,7 +85,7 @@ def test_get_coverage_for_batch():
print(f" {file}")

# Compare output with expected result using the OutputChecker
checker = OutputCheckerV2(
checker = OutputChecker(
workdir / "data",
expected_path,
workdir,
Expand Down
138 changes: 0 additions & 138 deletions workflow/.tests/unit/test_smk_testing.py

This file was deleted.

36 changes: 0 additions & 36 deletions workflow/rules/smk_testing.smk

This file was deleted.

0 comments on commit 3760a09

Please sign in to comment.