We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c55a5e commit 8f1eb8bCopy full SHA for 8f1eb8b
src/tlo/methods/demography.py
@@ -517,10 +517,10 @@ def assign_closest_facility_level(self):
517
}
518
519
# Worldpop-weighted coordinate assignment.
520
- # FIX: derive run_seed from the module RNG (not secrets/time) so results are
521
- # reproducible across runs that share the same random seed.
+ _rng_state = self.rng.get_state()
522
run_seed = self.rng.randint(0, 2 ** 31 - 1).to_bytes(4, "big")
523
- # FIX: sort districts so iteration order is deterministic regardless of PYTHONHASHSEED.
+ self.rng.set_state(_rng_state)
+
524
unique_districts = sorted(df["district_of_residence"].unique())
525
526
district_to_coords = {}
0 commit comments