Issue with AvoidPattern (and potentially other builtin_specifications)
See original GitHub issueIt looks as though AvoidPattern doesn’t preserve its strand information when being localized if the original strand information is ‘from_location’
Example illustrating this:
ipdb> cst
# AvoidPattern[4-1624(-)](pattern:AACAAAT)
ipdb> location
# 9-10
ipdb> new_cst = cst.localized(location, problem=self)
ipdb> new_cst
# AvoidPattern[4-16](pattern:AACAAAT)
ipdb> new_cst.location
# 4-16
ipdb> new_cst.strand
# 'from_location'
The from_location
is strand argument is preserved, but the original strand in the location is lost, so the resulting constraint loses the strandedness. I ran into this today when my optimization kept failing and the violated constraint was being reported on the positive strand even though that constraint should only be on the negative.
This was in version 3.2.6 (though the current code looks unchanged)
To fix this in the short term, it looks like I can specify the strand directly with its own argument when creating the constraint (let me know if this is not good for some reason).
This tool is very useful, thank you for the continued development!
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (12 by maintainers)
Thank you very much, I’ll take over from here and have a look tomorrow, Friday latest.
As for workflow, I just develop in
dev
then bump version when all issues are addressed, and merge withmaster
, then release it. (The reason is to have only 1 codebase for a given version number inmaster
.) I’ll write this up in a ‘contribute’ document or something as it may be useful to potential contributors.I guess the real root cause here was that I wrote
overlap_region
in a very confusing way and that bit us. This is (hopefully) solved via #61. Leaving it to you @veghp for review and release 👍