fix: Extending TS can now create lower cost alignment without panic#90
fix: Extending TS can now create lower cost alignment without panic#90sebschmi merged 1 commit intoalgbio:mainfrom
Conversation
|
Nice, thanks! I propose that we replace the former assertions |
d65fc15 to
5ccfe6a
Compare
|
Hey @sebschmi , this should be fine and all tests pass, but maybe you wanna take a look before we merge. Also, I've done a bit of refactoring to avoid panics in general, to allow for more graceful failure. |
sebschmi
left a comment
There was a problem hiding this comment.
Thanks, looks very nice. Two of the comments you made indicate a bug to me, as I commented at the specific lines. This kind of bug is something we may actually run into, in case an alignment starts with a TS, or in case the TS inner is at the boundary of the sequence.
0c9a1db to
8d40aa6
Compare
sebschmi
left a comment
There was a problem hiding this comment.
Thanks! I went over things again, and noticed that we would now panic in some cases in debug mode, but allow them in release mode. We (I) never run this code in debug mode though, because it is too slow. So best to still either panic when the assert indicates a programming error within the function, or return a Result::Err in case of violated preconditions of the method. But in case of violated preconditions, we can also just document that false is returned. But then again we may not want to panic in debug mode then...
I think cleanly using either asserts or return Result::Err is the best way to deal with these.
I marked some of the spots of this happening in the first method, but since the others are similar I didn't mark them.
8d40aa6 to
c7a9af8
Compare
|
I've implemented it now so that |
6a82083 to
58455d3
Compare
|
And now it's even rebased 🫡 |
58455d3 to
3880443
Compare
Apart from some reformatting, the only change is that the assertions on the new cost being equal are removed.
Closes #89