Skip to content

Commit 0368f7e

Browse files
committed
seed the RNG only with the mcreplica seed and not dataset name
1 parent 3ebb674 commit 0368f7e

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

validphys2/src/validphys/pseudodata.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -190,21 +190,8 @@ def make_replica(
190190
return np.concatenate(
191191
[cd.central_values for cd in groups_dataset_inputs_loaded_cd_with_cuts]
192192
)
193-
# Seed the numpy RNG with the seed and the name of the datasets in this run
194-
195-
# TODO: to be simplified after the reader is merged, together with an update of the regression tests
196-
# this is necessary to reproduce exactly the results due to the replicas being generated with a hash
197-
# Only when the sets are legacy (or coming from a legacy runcard) this shall be used
198-
names_for_salt = []
199-
for loaded_cd in groups_dataset_inputs_loaded_cd_with_cuts:
200-
if loaded_cd.legacy_names is None:
201-
names_for_salt.append(loaded_cd.setname)
202-
else:
203-
names_for_salt.append(loaded_cd.legacy_names[0])
204-
name_salt = "-".join(names_for_salt)
205-
206-
name_seed = int(hashlib.sha256(name_salt.encode()).hexdigest(), 16) % 10**8
207-
rng = np.random.default_rng(seed=replica_mcseed + name_seed)
193+
# Seed the numpy RNG with the replica_mcseed
194+
rng = np.random.default_rng(seed=replica_mcseed)
208195
# construct covmat
209196
covmat = dataset_inputs_sampling_covmat
210197
covmat_sqrt = sqrt_covmat(covmat)

0 commit comments

Comments
 (0)