From d26b853a33bd7951c8c74698d6d7ff984a5526e0 Mon Sep 17 00:00:00 2001 From: tjstruck Date: Wed, 14 Aug 2024 13:26:48 -0700 Subject: [PATCH] Update tests for change to subcommands (besides GenerateCache) that take popt file --- tests/test_Plot.py | 8 -------- tests/test_Stat.py | 17 +++-------------- tests/test_cli.py | 6 ------ tests/test_main.py | 1 - 4 files changed, 3 insertions(+), 29 deletions(-) diff --git a/tests/test_Plot.py b/tests/test_Plot.py index c6fd55c1..0d6fb729 100644 --- a/tests/test_Plot.py +++ b/tests/test_Plot.py @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", diff --git a/tests/test_Stat.py b/tests/test_Stat.py index 754304eb..f3e0b748 100644 --- a/tests/test_Stat.py +++ b/tests/test_Stat.py @@ -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( @@ -35,7 +34,6 @@ def test_StatDM_code(): bootstrap_dir, demo_popt, fixed_params, - nomisid, logscale, eps, ) @@ -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( @@ -62,7 +59,6 @@ def test_StatDM_fix_code(): bootstrap_dir, demo_popt, fixed_params, - nomisid, logscale, eps, ) @@ -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( @@ -93,7 +88,6 @@ def test_StatDFE_code_mix_lognormal(): bootstrap_non_dir, dfe_popt, fixed_params, - nomisid, logscale, eps, ) @@ -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( @@ -126,7 +119,6 @@ def test_StatDFE_code_1d_lognormal(): bootstrap_non_dir, dfe_popt, fixed_params, - nomisid, logscale, eps, ) @@ -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( @@ -159,7 +150,6 @@ def test_StatDFE_code_2d_lognormal(): bootstrap_non_dir, dfe_popt, fixed_params, - nomisid, logscale, eps, ) @@ -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 " @@ -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 " @@ -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 " diff --git a/tests/test_cli.py b/tests/test_cli.py index ff84c7df..e3ef5f19 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -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 @@ -495,7 +494,6 @@ def test_plot_args(): pdf1d, "--pdf2d", pdf2d, - "--nomisid", "--output", output, "--projections", @@ -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 @@ -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" @@ -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 @@ -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( diff --git a/tests/test_main.py b/tests/test_main.py index 3d30d583..e019db35 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -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