New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: multiple matching #1063
fix: multiple matching #1063
Conversation
Deploying with Cloudflare Pages
|
Codecov Report
@@ Coverage Diff @@
## main #1063 +/- ##
==========================================
+ Coverage 63.83% 63.98% +0.15%
==========================================
Files 59 59
Lines 7273 7309 +36
Branches 1629 1637 +8
==========================================
+ Hits 4643 4677 +34
- Misses 2528 2623 +95
+ Partials 102 9 -93
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
Turns out there are some pending questions that need to be resolved - I'm not merging the code yet. |
For |
For |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Again I’d like to get @wodeni’s approval on this before merging.
); | ||
const substTargets = im.Set<string>(Object.values(subst)); | ||
if (matchedRels !== undefined) { | ||
const record: im.Record<MatchesObject> = im.Record({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I didn’t know about Record
before!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out, im.Set
doesn't play nice if I just put JS/TS arrays in the Set.
i'm actually not sure, lemme look into that |
Looks like that is a local minimum - after resampling, they are disjoint. Update: Fixed in new commit - selected a new random variation. |
They are not merged together - they are still disjoint. The Style block for
so they try to clump together. This shows how the objective function changed - it is now assigning less weight to things like |
Description
Related issue/PR: #1062 AND #1064
This PR fixes #1062 and #1064 using the proposed resolution as written in #1064.
Implementation strategy and design decisions
See comments of #1064
Examples with steps to reproduce them
The current version prints two "Water!" strings on the canvas, even though the Substance program only has one water molecule. After this fix, it only prints one "Water!" as expected.
Checklist
diagrams/
folder