Skip to content

Commit

Permalink
Update tests for change to subcommands (besides GenerateCache) that t…
Browse files Browse the repository at this point in the history
…ake popt file
  • Loading branch information
tjstruck committed Aug 14, 2024
1 parent ded71d1 commit d26b853
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 29 deletions.
8 changes: 0 additions & 8 deletions tests/test_Plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ def test_plot_fitted_demography(files):
func=dadi.Demographics1D.two_epoch,
popt=pytest.fs1d_demo_popt,
projections=[8],
nomisid=True,
cov_args=[],
cov_inbreeding=[],
output="tests/test_results/plot_plot_fitted_demography_1d_w_proj.png",
Expand All @@ -139,7 +138,6 @@ def test_plot_fitted_demography(files):
func=dadi.Demographics2D.split_mig,
popt=pytest.fs2d_demo_popt,
projections=[8, 8],
nomisid=True,
cov_args=[],
cov_inbreeding=[],
output="tests/test_results/plot_plot_fitted_demography_2d_w_proj.png",
Expand All @@ -152,7 +150,6 @@ def test_plot_fitted_demography(files):
func=dadi.Demographics1D.two_epoch,
popt=pytest.fs1d_demo_popt,
projections=None,
nomisid=True,
cov_args=[],
cov_inbreeding=[],
output="tests/test_results/plot_plot_fitted_demography_1d_no_proj.png",
Expand All @@ -165,7 +162,6 @@ def test_plot_fitted_demography(files):
func=dadi.Demographics2D.split_mig,
popt=pytest.fs2d_demo_popt,
projections=None,
nomisid=True,
cov_args=[],
cov_inbreeding=[],
output="tests/test_results/plot_plot_fitted_demography_2d_no_proj.png",
Expand All @@ -178,7 +174,6 @@ def test_plot_fitted_demography(files):
func=dadi.Demographics3D.out_of_africa,
popt=pytest.fs3d_popt,
projections=None,
nomisid=False,
cov_args=[],
cov_inbreeding=[],
output="tests/test_results/plot_plot_fitted_demography_3d_no_proj.png",
Expand All @@ -192,7 +187,6 @@ def test_plot_fitted_demography(files):
func=dadi.Demographics2D.split_mig,
popt=pytest.fs2d_demo_popt,
projections=None,
nomisid=True,
cov_args=[pickle.load(open("./tests/example_data/LowPass-files/cov.fs.coverage.pickle", 'rb')), 20, 20],
cov_inbreeding=[],
output="tests/test_results/plot_plot_low-pass_demography.png",
Expand All @@ -212,7 +206,6 @@ def test_plot_fitted_dfe(files):
projections=[8, 8],
pdf="lognormal",
pdf2="biv_lognormal",
nomisid=True,
cov_args=[],
cov_inbreeding=[],
output="tests/test_results/plot_fitted_dfe_mixture_w_proj.png",
Expand All @@ -229,7 +222,6 @@ def test_plot_fitted_dfe(files):
projections=[8, 8],
pdf="lognormal",
pdf2="biv_lognormal",
nomisid=True,
cov_args=[pickle.load(open("./tests/example_data/LowPass-files/cov.fs.coverage.pickle", 'rb')), 20, 20],
cov_inbreeding=[],
output="tests/test_results/plot_fitted_dfe_mixture_w_proj.png",
Expand Down
17 changes: 3 additions & 14 deletions tests/test_Stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def test_StatDM_code():
bootstrap_dir = "./tests/example_data/split_mig_bootstrap_syn/"
demo_popt = "tests/example_data/example.split_mig.demo.params.InferDM.bestfits"
fixed_params = -1
nomisid = True
logscale = False
eps = [0.1]
godambe_stat_demograpy(
Expand All @@ -35,7 +34,6 @@ def test_StatDM_code():
bootstrap_dir,
demo_popt,
fixed_params,
nomisid,
logscale,
eps,
)
Expand All @@ -51,7 +49,6 @@ def test_StatDM_fix_code():
bootstrap_dir = "./tests/example_data/split_mig_bootstrap_syn/"
demo_popt = "tests/example_data/example.split_mig.demo.params.with.misid.InferDM.bestfits"
fixed_params = [-1, -1, 0.00984767, -1, -1]
nomisid = False
logscale = True
eps = [0.01, 0.1]
godambe_stat_demograpy(
Expand All @@ -62,7 +59,6 @@ def test_StatDM_fix_code():
bootstrap_dir,
demo_popt,
fixed_params,
nomisid,
logscale,
eps,
)
Expand All @@ -79,7 +75,6 @@ def test_StatDFE_code_mix_lognormal():
bootstrap_non_dir = "tests/example_data/split_mig_bootstrap_non/bootstrap_non_mix/"
dfe_popt = "tests/example_data/example.split_mig.dfe.lognormal_mixture.params.with.misid.InferDFE.bestfits"
fixed_params = [-1, -1, 0, -1, -1]
nomisid = False
logscale = False
eps = [0.01]
godambe_stat_dfe(
Expand All @@ -93,7 +88,6 @@ def test_StatDFE_code_mix_lognormal():
bootstrap_non_dir,
dfe_popt,
fixed_params,
nomisid,
logscale,
eps,
)
Expand All @@ -112,7 +106,6 @@ def test_StatDFE_code_1d_lognormal():
"tests/example_data/example.split_mig.dfe.1D_lognormal.params.with.misid.InferDFE.bestfits"
)
fixed_params = -1
nomisid = False
logscale = True
eps = [0.01]
godambe_stat_dfe(
Expand All @@ -126,7 +119,6 @@ def test_StatDFE_code_1d_lognormal():
bootstrap_non_dir,
dfe_popt,
fixed_params,
nomisid,
logscale,
eps,
)
Expand All @@ -145,7 +137,6 @@ def test_StatDFE_code_2d_lognormal():
"tests/example_data/example.split_mig.dfe.2D_lognormal.params.InferDFE.bestfits"
)
fixed_params = -1
nomisid = True
logscale = False
eps = [0.01]
godambe_stat_dfe(
Expand All @@ -159,7 +150,6 @@ def test_StatDFE_code_2d_lognormal():
bootstrap_non_dir,
dfe_popt,
fixed_params,
nomisid,
logscale,
eps,
)
Expand All @@ -178,7 +168,7 @@ def test_StatDFE_terminal_1d_lognormal():
)
eps = " 0.1 "
subprocess.run(
"dadi-cli StatDFE --nomisid"
"dadi-cli StatDFE"
+ " --fs "
+ fs
+ " --dfe-popt "
Expand Down Expand Up @@ -212,10 +202,9 @@ def test_StatDFE_terminal_2d_lognormal():
dfe_popt = (
"tests/example_data/example.split_mig.dfe.2D_lognormal.params.InferDFE.bestfits"
)
nomisid = True
logscale = False
subprocess.run(
"dadi-cli StatDFE --nomisid"
"dadi-cli StatDFE"
+ " --fs "
+ fs
+ " --dfe-popt "
Expand Down Expand Up @@ -247,7 +236,7 @@ def test_StatDFE_terminal_mix_lognormal():
dfe_popt = "tests/example_data/example.split_mig.dfe.lognormal_mixture.params.InferDFE.bestfits"
constants = "-1 -1 0 -1"
subprocess.run(
"dadi-cli StatDFE --nomisid"
"dadi-cli StatDFE"
+ " --fs "
+ fs
+ " --dfe-popt "
Expand Down
6 changes: 0 additions & 6 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ def test_plot_args():
cache2d = "tests/example_data/cache_split_mig_2d.bpkl"
pdf1d = "lognormal"
pdf2d = "biv_lognormal"
nomisid = True
output = "tests/test_results/plot_cli_test.png"
projections = [10, 10]
resid_range = 3
Expand Down Expand Up @@ -495,7 +494,6 @@ def test_plot_args():
pdf1d,
"--pdf2d",
pdf2d,
"--nomisid",
"--output",
output,
"--projections",
Expand All @@ -518,7 +516,6 @@ def test_plot_args():
assert args.cache2d == cache2d
assert args.pdf1d == pdf1d
assert args.pdf2d == pdf2d
assert args.nomisid == nomisid
assert args.output == output
assert args.projections == projections
assert args.resid_range == resid_range
Expand All @@ -532,7 +529,6 @@ def test_stat_dm_args():
fs = "tests/example_data/split_mig_syn.fs"
model = "split_mig"
grids = [60, 80, 100]
nomisid = False
output = "tests/test_results/example.cli.split_mig.demo.params.ci"
constants = -1
demo_popt = "tests/example_data/example.split_mig.demo.params.InferDM.bestfits"
Expand Down Expand Up @@ -562,7 +558,6 @@ def test_stat_dm_args():
assert args.fs == fs
assert args.model == model
assert args.grids == grids
assert args.nomisid == nomisid
assert args.output == output
assert args.constants == constants
assert args.demo_popt == demo_popt
Expand All @@ -584,7 +579,6 @@ def test_stat_dfe_args():
bootstrapping_nonsynonymous_dir = "tests/example_data/split_mig_bootstrap_non/bootstrap_non_mix/"
dfe_popt = "tests/example_data/example.split_mig.dfe.lognormal_mixture.params.with.misid.InferDFE.bestfits"
constants = [-1, -1, 0, -1, -1]
nomisid = False
logscale = False

args = parser.parse_args(
Expand Down
1 change: 0 additions & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,6 @@ def plot_args():
pytest.dfe_popt = "tests/example_data/example.split_mig.dfe.lognormal_mixture.params.InferDFE.bestfits"
pytest.cache1d = "tests/example_data/cache_split_mig_1d.bpkl"
pytest.cache2d = "tests/example_data/cache_split_mig_2d.bpkl"
pytest.nomisid = True
pytest.vmin = 1e-3
pytest.resid_range = 10
pytest.projections = None
Expand Down

0 comments on commit d26b853

Please sign in to comment.