castcollab / tesserae2

Tesserae2: Fast recombination-aware global and local alignment.
Other
3 stars 0 forks source link

Difficulties refactoring acceptance tests #3

Open winni2k opened 4 years ago

winni2k commented 4 years ago

I was trying to refactor https://github.com/castcollab/tesserae2/blob/master/tests/acceptance/test_tesserae.py#L11, but the acceptance tests would fail if I replaced random.choice with random.choices. choices uses a different randomization than choice. Could that be the cause, @kvg? And a related question: Why do we need to set the seed here: https://github.com/castcollab/tesserae2/blob/master/tests/acceptance/test_tesserae.py#L20

Depending on a seed for tests is difficult to work with because it essentially bars that code from being refactored in ways that break the randomization scheme.

kvg commented 4 years ago

I guess all we really need is a sufficient number of test sequences with known and acceptable alignments. This is all the test is really doing, albeit in a kinda lazy way. Shall I just replace it with a fixed set of sequences and alignments?

winni2k commented 4 years ago

Yes! That would be perfect!

winni2k commented 4 years ago

We are just trying to make sure the machinery is broadly working with the acceptance tests.

winni2k commented 4 years ago

In fact, is there a particular reason why the sequences are 100, 200, and 500 bases long?

In an ideal world I would instead like to see some corner case lengths. Perhaps 1,2, and 10 or 100 bases long? In that case we could probably calculate the exact probability of each Viterbi path by hand, no? But this is probably not that important right now.