Skip to content

Commit 448a3a8

Browse files
committed
Allow initial sizes to be specified for the tables
1 parent 82c0cc7 commit 448a3a8

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

tests/test_gigutil.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def test_inversion(self):
345345

346346
# Can progress the simulation
347347
gig = self.simulator.run_more(
348-
num_diploids=100,
348+
num_diploids=final_pop_size,
349349
gens=self.default_gens - 1,
350350
random_seed=1,
351351
progress_monitor=self.progress_monitor,
@@ -440,7 +440,15 @@ def test_tandem_duplication(self):
440440
test.test_tandem_duplication()
441441
print(test.gig)
442442
"""
443-
self.simulator = sim.DTWF_one_break_no_rec_inversions_slow(self.iedge_validate)
443+
final_pop_size = 100
444+
self.simulator = sim.DTWF_one_break_no_rec_inversions_slow(
445+
self.iedge_validate,
446+
initial_sizes={
447+
"nodes": 2 * final_pop_size * self.default_gens,
448+
"edges": 2 * final_pop_size * self.default_gens * 2,
449+
"individuals": final_pop_size * self.default_gens,
450+
},
451+
)
444452
self.simulator.run(
445453
num_diploids=2,
446454
seq_len=self.seq_len,
@@ -503,7 +511,7 @@ def test_tandem_duplication(self):
503511

504512
# Can progress the simulation
505513
gig = self.simulator.run_more(
506-
num_diploids=100,
514+
num_diploids=final_pop_size,
507515
gens=self.default_gens - 1,
508516
random_seed=1,
509517
progress_monitor=self.progress_monitor,
@@ -514,7 +522,7 @@ def test_tandem_duplication(self):
514522
self.gig = gig
515523
# Check that there are a number of duplicated regions:
516524

517-
lengths = [gig.max_position(u) for u in gig.samples]
525+
lengths = [gig.sequence_length(u) for u in gig.samples]
518526
unique_lengths = np.unique(lengths)
519527
assert len(unique_lengths) > 2
520528
assert np.all((np.diff(unique_lengths) % np.diff(self.duplication)) == 0)

0 commit comments

Comments
 (0)