Skip to content
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

feat: Persistent homology example #1007

Merged
merged 7 commits into from
May 24, 2022
Merged

feat: Persistent homology example #1007

merged 7 commits into from
May 24, 2022

Conversation

jiriminarcik
Copy link
Contributor

@jiriminarcik jiriminarcik commented May 23, 2022

Description

This PR adds new example illustrating Persistent homology.

Implementation strategy and design decisions

The example was added to the registry.

Examples with steps to reproduce them

Run npx roger watch persistent-homology.sub persistent-homology.sty persistent-homology.dsl from/packages/examples/src/persistent-homology. Or npx roger watch persistent-homology.sub persistent-homology.sty persistent-homology-basic.dsl for a simplified version without labels.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new ESLint warnings
  • I have reviewed any generated changes to the diagrams/ folder

Open questions

@codecov
Copy link

codecov bot commented May 23, 2022

Codecov Report

Merging #1007 (ce10bb9) into main (15053e3) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1007   +/-   ##
=======================================
  Coverage   63.63%   63.63%           
=======================================
  Files          62       62           
  Lines        7801     7801           
  Branches     1784     1784           
=======================================
  Hits         4964     4964           
  Misses       2723     2723           
  Partials      114      114           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 15053e3...ce10bb9. Read the comment docs.

@cloudflare-pages
Copy link

cloudflare-pages bot commented May 23, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: ce10bb9
Status: ✅  Deploy successful!
Preview URL: https://d7f1302c.penrose-72l.pages.dev

View logs

@jiriminarcik jiriminarcik marked this pull request as ready for review May 23, 2022 22:00
Copy link
Collaborator

@samestep samestep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super cool!

@jiriminarcik jiriminarcik merged commit 299145b into main May 24, 2022
@joshsunshine
Copy link
Member

joshsunshine commented Aug 2, 2022

@jiriminarcik can you explain exactly how you would use not in this example?

@minarj
Copy link
Contributor

minarj commented Aug 3, 2022

@jiriminarcik can you explain exactly how you would use not in this example?

In this example I need to make sure that two circles overlap iff the respective points satisfy e.g. the ConnectedOnFrame1 predicate, otherwise they must be disjoint. It is straightforward to enforce the positive condition, but not the negative one.

The current work-around involves defining the NotConnectedOnFrame1 predicate and explicitly writing down all combinations of points for which ConnectedOnFrame1 does not hold in .sub file.

With not, we could just use ConnectedOnFrame1 and write (in .sty):

forall Point p1; Point p2 
where not ConnectedOnFrame1(p1, p2) {
  ensure disjoint(p1.circle1, p2.circle1, 10)
}

instead of the current work-around:

forall Point p1; Point p2 
where NotConnectedOnFrame1(p1, p2) {
  ensure disjoint(p1.circle1, p2.circle1, 10)
}

This would eliminate most of the lines in packages/examples/src/persistent-homology/persistent-homology.sub (see comment on line 43).

@samestep samestep deleted the persistent-homology branch March 15, 2023 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants