Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix dependencies #3

Merged
merged 5 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading