Commit eda11225 authored by Antoine Berchet's avatar Antoine Berchet
Browse files

Computing 2 EnSRF with reasonable and very large number of samples respectively in pytest

parent 692cc060
......@@ -6,5 +6,5 @@ dir_out=/home/satellites13/aberchet/cif_paper/simulations_`date +'%Y%m%d'`
dir_out=/homel/aberchet/test_article/simulations_`date +'%Y%m%d'`
mkdir -p $dir_out
cd ..
pytest -s -m "(dummy and article and inversion and not adjtltest and uncertainties) or (fwd and ref_config)" \
pytest -s -m "(dummy and article and inversion and not adjtltest and not uncertainties) or (fwd and ref_config)" \
--html reports/pytest.html --self-contained-html --basetemp=$dir_out/ ./
......@@ -18,12 +18,14 @@ from pycif.utils.path import init_dir
@pytest.mark.article
@pytest.mark.parametrize(
"settings", [
# {"mode": "4dvar", "minimizer": "M1QN3"},
# pytest.param({"mode": "4dvar", "minimizer": "M1QN3", "montecarlo": 10},
# marks=pytest.mark.uncertainties),
{"mode": "4dvar", "minimizer": "M1QN3"},
pytest.param({"mode": "4dvar", "minimizer": "M1QN3", "montecarlo": 10},
marks=pytest.mark.uncertainties),
{"mode": "4dvar", "minimizer": "congrad"},
# {"mode": "ensrf"},
# {"mode": "analytical"}
{"mode": "ensrf"},
pytest.param({"mode": "ensrf", "nsimmax": 250},
marks=pytest.mark.uncertainties),
{"mode": "analytical"}
]
)
def test_integration_inversion(dummy_config_inversion, settings, pytestconfig):
......@@ -38,7 +40,7 @@ def test_integration_inversion(dummy_config_inversion, settings, pytestconfig):
config["model"]["reload_H"] = "{}/../H_matrix.pickle".format(tmpdir)
# Changing mode
nsimmax = 10
nsimmax = settings.get("nsimmax", 10)
if config["datavect"]["components"]["fluxes"]\
["parameters"]["CH4"]["hresol"] == "hpixels":
nsimmax = 25
......@@ -317,7 +319,8 @@ def test_integration_inversion(dummy_config_inversion, settings, pytestconfig):
os.path.abspath(os.path.join(current_dir,
"../../figures_artifact/"))
Path(figure_dir).mkdir(parents=True, exist_ok=True)
plt.savefig("{}/map_dx_{}_{}.pdf".format(figure_dir, title, resol))
plt.savefig("{}/map_dx_{}_{}_{}.pdf".format(
figure_dir, title, resol, nsimmax))
plt.close()
# Plot uncertainty reduction
......@@ -354,8 +357,8 @@ def test_integration_inversion(dummy_config_inversion, settings, pytestconfig):
os.path.abspath(os.path.join(current_dir,
"../../figures_artifact/"))
Path(figure_dir).mkdir(parents=True, exist_ok=True)
plt.savefig("{}/map_dstd_{}_{}.pdf"
.format(figure_dir, title, resol))
plt.savefig("{}/map_dstd_{}_{}_{}.pdf"
.format(figure_dir, title, resol, nsimmax))
plt.close()
# Plot matrix of uncertainty reduction
......@@ -372,7 +375,7 @@ def test_integration_inversion(dummy_config_inversion, settings, pytestconfig):
os.path.abspath(os.path.join(current_dir,
"../../figures_artifact/"))
Path(figure_dir).mkdir(parents=True, exist_ok=True)
plt.savefig("{}/uncertaintyreduc_matrix_{}_{}.pdf"
.format(figure_dir, title, resol))
plt.savefig("{}/uncertaintyreduc_matrix_{}_{}_{}.pdf"
.format(figure_dir, title, resol, nsimmax))
plt.close()
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment