Skip to content

Commit

Permalink
Tweak some parameters to get tests passing
Browse files Browse the repository at this point in the history
  • Loading branch information
DRMacIver committed Nov 28, 2024
1 parent 715cb41 commit 8dfda65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ehrql/dummy_data_nextgen/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,9 @@ def empty_rows(self, table_info):
if table_info.has_one_row_per_patient:
row_count = self.rnd.randint(0, 1)
else:
# Geometric distribution with parameter 0.25. Will 3 events per patient.
row_count = math.floor(math.log(self.rnd.random()) / math.log(1 - 0.25))
# Geometric distribution with parameter 0.2. Will average 4 (=1/0.2 - 1) events
# per patient.
row_count = math.floor(math.log(self.rnd.random()) / math.log(1 - 0.2))
if self.required_tables and table_info.name in self.required_tables:
row_count += 1
return [{} for _ in range(row_count)]
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/dummy_data_nextgen/test_measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_dummy_measures_data_generator():

intervals = years(2).starting_on("2020-01-01")
measures = Measures()
measures.dummy_data_config.population_size = 200
measures.dummy_data_config.population_size = 300

measures.define_measure(
"foo_events_by_sex",
Expand Down

0 comments on commit 8dfda65

Please sign in to comment.