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

refactor!: clean up core exports and synthesizer modules #1367

Merged
merged 12 commits into from May 10, 2023

Conversation

wodeni
Copy link
Member

@wodeni wodeni commented May 9, 2023

Description

Resolves #1255.

This PR cleans up exported functions and types from core and move synthesizer-related modules to synthesizer-ui. @penrose/synthesizer, the CLI for core/synthesis is also deprecated.

Implementation strategy and design decisions

  • We opted for a single entry point for core exports, i.e. dist/index.js, for all types and functions
  • The alternative is subpath exports but it requires special configuration on the client side. Therefore, it'll require a manual build system to get something like import { compileSubstance } from "@penrose/core/compiler/Substance" to work.
  • @penrose/synthesizer-ui is renamed to @penrose/edgeworth
  • Both synthesis and analysis folders in core are moved to @penrose/edgeworth

Examples with steps to reproduce them

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have reviewed any generated registry diagram changes

Open questions

We might consider banning direct imports of subpaths of dist to reduce the surface area of the core API.

@wodeni wodeni marked this pull request as draft May 9, 2023 16:20
@github-actions
Copy link

github-actions bot commented May 9, 2023

± Registry diff

📊 Performance

Key

Note that each bar component rounds up to the nearest 100ms, so each full bar is an overestimate by up to 400ms.

     0s   1s   2s   3s   4s   5s   6s   7s   8s   9s
     |    |    |    |    |    |    |    |    |    |
name ▝▀▀▀▀▀▀▀▀▀▀▀▚▄▄▄▄▄▄▄▄▄▞▀▀▀▀▀▀▀▀▀▀▀▀▚▄▄▄▄▄▄▄▄▄▖
      compilation labelling optimization rendering

Data

                                                                  0s   1s   2s   3s   4s   5s   6s
                                                                  |    |    |    |    |    |    |
3d-projection-fake-3d-linear-algebra                              ▝▞▖
acquaintanceship-graph-simple-graph                               ▝▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▚▀▀▀▀▀▀▀▖
allShapes-allShapes                                               ▝▚▚▄
angle-equivalence-triangle-mesh-2d                                ▝▀▀▞▀▚
arrowheads-arrowheads                                             ▝▞▖
caffeine-structural-formula                                       ▝▀▀▚▚
call-directed-graph-directed-multigraph                           ▝▀▀▀▀▀▚▀▀▖
call-undirected-graph-pseudograph                                 ▝▀▀▀▀▀▞▚
center-shrink-circle-animation                                    ▝▞▖
circle-example-euclidean                                          ▝▀▞▖
closest-point-test-closest-point                                  ▝▀▀▀▀▀▀▀▞▖
collinear-euclidean                                               ▝▀▞▖
communications-network-one-way-links-graph-simple-directed-graph  ▝▀▀▀▀▀▚▀▖
complete-bipartite-graphs-simple-graph                            ▝▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▞▀▀▖
complete-graphs-simple-graph                                      ▝▀▀▀▀▀▀▀▀▀▀▚▀▀▖
computer-network-diagnostic-links-graph-pseudograph               ▝▀▀▀▀▚▚
computer-network-graph-simple-graph                               ▝▀▀▀▞▖
computer-network-multiple-links-graph-pseudograph                 ▝▀▀▀▀▚▀▚
computer-network-multiple-one-way-links-graph-directed-multigraph ▝▀▀▀▀▀▀▚▀▖
concyclic-pair-triangle-mesh-2d                                   ▝▀▞▖
congruent-triangles-euclidean                                     ▝▀▀▚▚
continuousmap-continuousmap                                       ▝▞▖
cotan-formula-triangle-mesh-2d                                    ▝▀▞▖
cube-graphs-simple-graph                                          ▝▀▀▀▀▀▀▀▀▀▀▚▀▚
cubic-bezier-cubic-bezier                                         ▝▚▀▚
cycle-graphs-simple-graph                                         ▝▀▀▀▀▀▀▞▀▖
glutamine-molecules-basic                                         ▝▀▚▚
half-adder-distinctive-shape                                      ▝▚▚
halfedge-mesh-triangle-mesh-2d                                    ▝▀▞▖
hybrid-topology-graph-simple-graph                                ▝▀▀▞▖
hypercube-network-graph-simple-graph                              ▝▀▀▀▀▞▖
hypergraph-hypergraph                                             ▝▀▀▀▞▀▀▀▀▀▀▀▚
incenter-triangle-euclidean                                       ▝▀▞▖
influence-graph-simple-directed-graph                             ▝▀▀▞▖
jobs-trained-matching-graph-simple-graph                          ▝▀▀▀▚▀▖
jobs-trained-no-matching-graph-simple-graph                       ▝▀▀▀▞▖
lagrange-bases-lagrange-bases                                     ▝▚▚
linear-array-graph-simple-graph                                   ▝▀▀▚▚
lines-around-rect-rect-line-dist                                  ▝▚▚
matrix-matrix-addition-matrix-ops                                 ▝▚▚
matrix-matrix-division-elementwise-matrix-ops                     ▝▚▚
matrix-matrix-multiplication-elementwise-matrix-ops               ▝▚▚
matrix-matrix-multiplication-matrix-ops                           ▝▚▚
matrix-matrix-subtraction-matrix-ops                              ▝▚▚
matrix-transpose-matrix-ops                                       ▝▚▚
matrix-vector-left-multiplication-matrix-ops                      ▝▚▚
matrix-vector-right-multiplication-matrix-ops                     ▝▚▚
mesh-network-graph-simple-graph                                   ▝▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▚▀▀▀▀▀▀▀▀▀▀▚
midsegment-triangles-euclidean                                    ▝▀▞▖
mobius-mobius                                                     ▝▞▖
module-dependency-graph-simple-directed-graph                     ▝▀▀▀▚▀▖
niche-overlap-graph-simple-graph                                  ▝▀▀▀▀▀▞▖
nitricacid-lewis                                                  ▝▀▀▞▀▖
non-convex-non-convex                                             ▝▀▞▖
one-water-molecule-atoms-and-bonds                                ▝▞▖
parallel-lines-euclidean                                          ▝▀▞▖
persistent-homology-persistent-homology                           ▝▀▀▞▀▀▀▀▀▀▀▄
points-around-line-shape-distance                                 ▝▀▞▖
points-around-polyline-shape-distance                             ▝▀▀▞▖
points-around-star-shape-distance                                 ▝▀▀▀▞▖
precedence-graph-simple-directed-graph                            ▝▀▀▀▞▖
protein-interaction-graph-simple-graph                            ▝▀▀▀▀▀▀▚▀▀▚
quaternion-group-group-theory-cayley-graph                        ▝▀▚▚
quaternion-group-group-theory-multiplication-table                ▝▀▀▀▚▄▚
relative-orientation-triangle-mesh-2d                             ▝▀▞▖
ring-topology-graph-simple-graph                                  ▝▀▚▚
round-robin-graph-simple-directed-graph                           ▝▀▀▀▀▚▚
scalar-vector-division-matrix-ops                                 ▝▚▚
scalar-vector-left-multiplication-matrix-ops                      ▝▚▚
scalar-vector-right-multiplication-matrix-ops                     ▝▚▚
siggraph-teaser-euclidean-teaser                                  ▝▀▚▚
star-topology-graph-simple-graph                                  ▝▀▚▚
tree-tree                                                         ▝▚▚
tree-venn                                                         ▝▀▚▚
tree-venn-3d                                                      ▝▀▞▄▄▄
triangle-centers-triangle-mesh-2d                                 ▝▚▚
two-triangles-triangle-mesh-3d                                    ▝▚▚
two-vectors-perp-vectors-dashed                                   ▝▚▚
union-graph-simple-graph                                          ▝▀▀▀▞▖
vector-vector-addition-matrix-ops                                 ▝▚▚
vector-vector-division-elementwise-matrix-ops                     ▝▚▚
vector-vector-multiplication-elementwise-matrix-ops               ▝▚▚
vector-vector-outerproduct-matrix-ops                             ▝▚▚
vector-vector-subtraction-matrix-ops                              ▝▚▚
vector-wedge-exterior-algebra                                     ▝▚▚
wet-floor-atoms-and-bonds                                         ▝▀▞▚
wheel-graphs-simple-graph                                         ▝▀▀▀▀▀▀▀▀▀▀▞▀▚
word-cloud-example-word-cloud                                     ▝▀▞▖
wos-laplace-estimator-walk-on-spheres                             ▝▀▚▚
wos-nested-estimator-walk-on-spheres                              ▝▀▀▀▞▀▖
wos-offcenter-estimator-walk-on-spheres                           ▝▀▞▚
wos-poisson-estimator-walk-on-spheres                             ▝▀▚▀▖

@codecov
Copy link

codecov bot commented May 9, 2023

Codecov Report

Merging #1367 (6d88f28) into main (7536da0) will increase coverage by 1.96%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1367      +/-   ##
==========================================
+ Coverage   62.70%   64.67%   +1.96%     
==========================================
  Files          70       65       -5     
  Lines        8738     7597    -1141     
  Branches     2110     1800     -310     
==========================================
- Hits         5479     4913     -566     
+ Misses       3116     2554     -562     
+ Partials      143      130      -13     
Impacted Files Coverage Δ
packages/core/src/index.ts 42.85% <ø> (ø)

... and 6 files with indirect coverage changes

@cloudflare-pages
Copy link

cloudflare-pages bot commented May 9, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6d88f28
Status: ✅  Deploy successful!
Preview URL: https://3a81d9d2.penrose-72l.pages.dev
Branch Preview URL: https://clean-core-exports.penrose-72l.pages.dev

View logs

@wodeni wodeni marked this pull request as ready for review May 9, 2023 20:32
@wodeni wodeni requested a review from samestep May 9, 2023 20:34
@wodeni wodeni changed the title refactor: clean up core exports and synthesizer modules refactor!: clean up core exports and synthesizer modules May 9, 2023
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.

Looks great to me! A couple minor requests; the other important thing is to make sure the tests we've moved to @penrose/edgeworth still run after this change.

penrose.code-workspace Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
packages/edgeworth/tsconfig.json Show resolved Hide resolved
@wodeni wodeni requested a review from samestep May 10, 2023 15:15
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.

Looks great!

@wodeni wodeni merged commit cf24aaa into main May 10, 2023
10 checks passed
@wodeni wodeni deleted the clean-core-exports branch May 10, 2023 15:17
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.

Clean up core exports
2 participants