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

Sequence parser #68

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

szymonlopaciuk
Copy link
Contributor

Description

Provide features required by xsuite/xtrack#515:

  • Add a BaseRef._formatted(formatter) method that returns a string corresponding to a representation of a Ref/and Expr according to the formatter.
  • Add a _set_to_expr method that can reset the expression calculating the value of said ref.
  • Introduce a LiteralExpr to enable the possibility of wrapping scalars: this can allow us to preserve the tree of an expression in full.
  • Add a Manager.structure field that maps a ref to the refs that structurally depend on it (array element to the array, attribute to the owner, etc.). This is needed for fast retrieval of expressions from their "parent" containers.

Checklist

Mandatory:

  • I have added tests to cover my changes
  • All the tests are passing, including my new ones
  • I described my changes in this PR description

Optional:

  • The code I wrote follows good style practices (see PEP 8 and PEP 20).
  • I have updated the docs in relation to my changes, if applicable
  • I have tested also GPU contexts

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.

1 participant