Skip to content

Commit ae3c333

Browse files
committed
test that t0 sampling is different from exp
1 parent 15c0c93 commit ae3c333

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

validphys2/src/validphys/tests/test_pythonmakereplica.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from validphys.api import API
1515
from validphys.tests.conftest import DATA
1616
from validphys.tests.test_covmats import CORR_DATA
17+
from validphys.tests.conftest import PDF
1718

1819
SEED = 123456
1920

@@ -81,6 +82,29 @@ def test_pseudodata_seeding(data_config, dataset_inputs, use_cuts):
8182
np.testing.assert_allclose(rep_1, rep_2)
8283

8384

85+
@pytest.mark.parametrize("dataset_inputs", [DATA, CORR_DATA])
86+
def test_pseudodata_t0_and_not(data_config, dataset_inputs):
87+
"""
88+
Check that using t0-sampling produces different pseudodata to not using
89+
t0-sampling.
90+
"""
91+
config = dict(data_config)
92+
config["dataset_inputs"] = dataset_inputs
93+
config["use_cuts"] = "internal"
94+
config["replica_mcseed"] = SEED
95+
config["use_t0"] = True
96+
config["t0pdfset"] = PDF
97+
98+
config2 = deepcopy(config)
99+
config2["use_t0_sampling"] = True
100+
101+
rep_1 = API.make_replica(**config)
102+
rep_2 = API.make_replica(**config2)
103+
104+
# Check that the two replicas are different
105+
assert not np.allclose(rep_1, rep_2)
106+
107+
84108
@pytest.mark.parametrize("use_cuts", ["nocuts", "internal"])
85109
@pytest.mark.parametrize("dataset_inputs", [DATA, CORR_DATA, SINGLE_SYS_DATASETS])
86110
def test_pseudodata_has_correct_ndata(data_config, dataset_inputs, use_cuts):

0 commit comments

Comments
 (0)