PALS Python 0.3.0, Unit Convention for Quad#1357
Conversation
|
Oh, probably needs to update the analysis in |
|
@ax3l In the ImpactX parsing lines, we just need to check whether PALS input |
9a1e4af to
fa61eba
Compare
Update dependencies, not yet API changes.
New schema used in PALS.
- flatten PALS structure - address beaking API change in multipole/quad
| def flatten_pals(pals_data, registry=None): | ||
| """Flatten a PALS root, lattice, or beamline to a list of PALS elements. | ||
|
|
||
| Placeholder references are resolved from the root facility definitions. | ||
| """ | ||
| from pals import BeamLine, Lattice, PALSroot, PlaceholderName | ||
|
|
||
| if registry is None: | ||
| registry = {} | ||
|
|
||
| if isinstance(pals_data, PALSroot): | ||
| registry = { | ||
| item.name: item | ||
| for item in pals_data.facility | ||
| if not isinstance(item, PlaceholderName) and hasattr(item, "name") | ||
| } | ||
|
|
||
| if len(pals_data.facility) == 1: |
There was a problem hiding this comment.
flatten_pals and the inner details of from_pals deserve to go into their own src/python/impactx/pals_to_impactx.py file, but maybe as a follow-up PR.
| ) | ||
|
|
||
|
|
||
| def flatten_pals(pals_data, registry=None): |
There was a problem hiding this comment.
flatten_pals could be a helper routine in pals-python, for the next release of it.
I am surprised that we still have placeholders at this point in the logic, we probably should replace placeholders / do lattice expansion already in pals.load() -- to check if as an optional argument (i.e. lattice_expansion=True). To check lattice and branch expansion.
There was a problem hiding this comment.
For the next release (not this PR): pals-project/pals-python#70
Update PALS-Python from 0.2.0 to 0.3.0
Fix unit convention for PALS Quad support
PALS support requires additional implementation of translation on the ImpactX side.
For the PALS Quad, the option of specifying gradient in two unit systems, as
Bn1orKn1, needs to be supported. This PR fixes the existing choice of units.