Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with AvoidPattern (and potentially other builtin_specifications)

See original GitHub issue

It 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:closed
  • Created 2 years ago
  • Comments:14 (12 by maintainers)

github_iconTop GitHub Comments

veghpcommented, Jul 21, 2021

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 with master, then release it. (The reason is to have only 1 codebase for a given version number in master.) I’ll write this up in a ‘contribute’ document or something as it may be useful to potential contributors.

Zulkocommented, Jul 21, 2021

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 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

XML Schema Part 2: Datatypes Second Edition - W3C
It defines facilities for defining datatypes to be used in XML Schemas as well as other XML specifications. The datatype language, which is ......
Read more >
Event Sourcing pattern - Azure Architecture Center
Event sourcing can help prevent concurrent updates from causing conflicts because it avoids the requirement to directly update objects in the data store. ......
Read more >
7 Steps to Ensure and Sustain Data Quality | by Stephanie Shen
In other words, data quality is not something that can be fundamentally improved by finding problems and fixing them.
Read more >
What is Moiré and How it Can Ruin Your Photos
Moiré pattern occurs when a scene or an object that is being photographed contains fine, repetitive details that exceed sensor resolution. As a ......
Read more >
19 Unconscious Bias Examples and How to Prevent ... - Asana
To combat unconscious bias, learn about different types of biases, how they might surface at work, and how to avoid them so you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found