Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
noscode committed Apr 21, 2024
1 parent f74b959 commit aa2d858
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tests/test_dem_model_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ def model_generator(structure):
for i in range(len(model.variables)):
var = model.variables[i]
if isinstance(var, PopulationSizeVariable):
model.variables[i].domain = [1e-1, 5.]
if var.name == "Nanc":
model.variables[i].domain = [1000, 2000]
else:
model.variables[i].domain = [1e-1, 5.]
elif isinstance(var, TimeVariable):
model.variables[i].domain = [0.1, 1.]
elif isinstance(var, MigrationVariable):
Expand Down Expand Up @@ -236,7 +239,7 @@ def model_generator(structure):
sizes = [8 for _ in range(len(structure))]
if len(structure) == 1:
sizes = [20]
kwargs = {"pts": [10, 12, 14]} # pts
kwargs = {"pts": [8, 10, 12]} # pts
else:
sizes = [4 for _ in range(len(structure))]
kwargs = {}
Expand Down Expand Up @@ -306,15 +309,17 @@ def model_generator(structure):
self.assertTrue(is_equal,
msg=f"{ll_true} != {new_ll} : {msg}")
except AttributeError as e:
assert engine.id in ["dadi"], str(e)
print(e)
assert engine.id in ["dadi"]
failed += 1
except TypeError as e:
assert engine.id in ["dadi"], str(e)
print(e)
assert engine.id in ["dadi"]
failed += 1

dm.final_structure = dm.get_structure()
self.assertRaises(ValueError, dm.increase_structure)
self.assertTrue(failed <= 5, "Dadi failed more that 5 times")
self.assertTrue(failed <= 5, "Dadi and momi2 failed more that 5 times")

def _data_for_ll_ld_test(self, ii):
return VCFDataHolder(
Expand Down

0 comments on commit aa2d858

Please sign in to comment.