Skip to content

Commit 0cb0710

Browse files
committed
Fix rare NoSolutionError
At max_homology_length = 5 no solution is found sometimes.
1 parent 7f7bb09 commit 0cb0710

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
"""Example of use of the AvoidChanges as an objective to minimize modifications
22
of a sequence."""
33

4+
import numpy
5+
46
from dnachisel import AllowPrimer, DnaOptimizationProblem
57

68

79
def test_AllowPrimer():
10+
numpy.random.seed(123)
811
primers = ["ATTGCGCCAAACT", "TAATCCACCCTAAT", "ATTCACACTTCAA"]
912
problem = DnaOptimizationProblem(
1013
sequence=40 * "A",
1114
constraints=[
1215
AllowPrimer(
1316
tmin=50,
1417
tmax=60,
15-
max_homology_length=5,
18+
max_homology_length=7,
1619
location=(10, 30),
1720
avoid_heterodim_with=primers,
1821
)
1922
],
20-
logger=None
23+
logger=None,
2124
)
2225
problem.resolve_constraints()
2326
assert problem.all_constraints_pass()

0 commit comments

Comments
 (0)