Skip to content

Commit

Permalink
Merge pull request #3 from blab/fix-deps
Browse files Browse the repository at this point in the history
Fix dependencies
  • Loading branch information
huddlej authored Sep 4, 2024
2 parents afd7f00 + 1e44191 commit 1406e14
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ classifiers = [
dependencies = [
"jellyfish >=0.8.2, ==0.*",
"opencv-python >=4.5, ==4.*",
"numpy >=1.17.0, ==1.*",
"pandas >=1.2.0, ==1.*",
"scipy >=1.5.4, ==1.*",
]
Expand All @@ -29,7 +30,6 @@ dependencies = [
test = [
"coverage[toml] >=5.2.1, ==5.*",
"cram >=0.7, ==0.*",
"deepdiff[cli] >=5.2.0, ==5.*",
"flake8 >=3.9.0, ==3.*",
"pylint >=2.14.5, ==2.*",
]
Expand Down
41 changes: 41 additions & 0 deletions scripts/diff_tsv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""Compare TSV files line by line with deepdiff
"""
import argparse
import deepdiff
import pandas as pd


if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Compare TSV files line by line with deepdiff",
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
parser.add_argument("first_tsv", help="first TSV to compare")
parser.add_argument("second_tsv", help="second TSV to compare")
parser.add_argument("--significant-digits", type=int, default=6, help="number of significant digits to use when comparing numeric values")

args = parser.parse_args()

first_tsv = pd.read_csv(
args.first_tsv,
sep="\t",
header=None,
engine="python",
na_filter=False,
).to_dict()

second_tsv = pd.read_csv(
args.second_tsv,
sep="\t",
header=None,
engine="python",
na_filter=False,
).to_dict()

print(
deepdiff.DeepDiff(
first_tsv,
second_tsv,
significant_digits=args.significant_digits,
)
)
3 changes: 0 additions & 3 deletions tests/functional/forecast.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ Forecast frequencies with a model trained on simulated data.
> --model data/simulated_sample_1/normalized_fitness.json \
> --delta-months 12 \
> --output-table "$TMP/forecasts.tsv" > /dev/null
$ deep diff --significant-digits 6 "data/simulated_sample_1/forecasts.tsv" "$TMP/forecasts.tsv"
{}
$ rm -f "$TMP/forecasts.tsv"

Forecast tips with existing frequencies.

Expand Down

0 comments on commit 1406e14

Please # to comment.