aws-cqc / aws-cqc/DeviceLayout.jl

Composite styles

Open
#101 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Julia
Stars
67
Forks
14
Avg merge
1d 16h
Merged PRs (30d)
21

Description

Copying Hugh's description from the pre-release tracker:

Presently the mechanism for applying a composite style is through repeated call to `styled`: `styled(styled(ent, sty_lower), sty_upper)`, which results in `StyledEntity` that has a `StyledEntity` for it's `ent` field.

There are a few difficulties with this:
1) It isn't possible to store such a combination upfront to apply to multiple entities, this clashes with the design of `StyleDict`.
2) When applying compositions of styles such as `Optional(Rounded())` and `Optional(MeshSized())`, the resolution of `to_primitives` can result in ambiguous combinations. The options in this scenario are additive, if the `Rounded` is active, the primitive changes, and if the `MeshSized` is present then `meshgrading` and `meshsize` change.

It would be ideal to allow something like `sty = Rounded() ∘ MeshSized()` to construct such styles.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the existing styled calls and the StyledEntity and StyleDict concepts described in the issue, then inspect how to_primitives resolves Optional(Rounded()) and Optional(MeshSized()). Done should provide a reusable composition of styles that can be applied to multiple entities without ambiguous primitive resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.