Skip to content

Rebuild apg on upstream 0.3.2 - #3

Closed
thellert wants to merge 4 commits into
base/upstream-0.3.2from
sync/upstream-0.3.2
Closed

thellert wants to merge 4 commits into
base/upstream-0.3.2from
sync/upstream-0.3.2

Conversation

@thellert

@thellert thellert commented Oct 17, 2026 •

Copy link
Copy Markdown

Rebuilds apg on upstream release 0.3.2 (5d904043) as a patch stack, to be released as 0.3.1.post2's successor 0.3.2.post1.

The stack, replayed in order on the tag:

  1. build: publish as accelerator-middle-layer-apg (unchanged replay of e73fadea)
  2. feat(tuning_tools): add first-turn trajectory correction tool (unchanged replay of d0212c99)
  3. test(tuning_tools): skip golden tests when the goldens file is absent (unchanged replay of f4eadfae)
  4. ci: publish only .postN tags from the fork (new: a plain X.Y.Z tag is upstream's release and must not publish under the fork's name)

All three replays applied without conflicts. The three upstream commits apg carried below its stack (46e3cbee, 929df186, d6749769) are already in 0.3.2 as equivalent patches, so the stack holds only fork commits.

The PR targets base/upstream-0.3.2 (upstream 0.3.2's commit), so its diff is exactly the stack. Once CI is green, apg moves to this branch's head with --force-with-lease instead of a merge; the previous line stays reachable through tag 0.3.1.post2.

Local check: the trajectory tests (494) pass on 0.3.2.

Rename the distribution, admit .postN tags in the PyPI workflow and run it
in the pypi environment, and say in the README what this fork is. The
import package stays pyaml.
pyAML had no tool for steering the beam through the first turn, when only
the BPMs upstream of the loss point see a trajectory and an orbit
correction cannot be applied.

Trajectory is a tuning tool built from a trajectory response matrix
(OrbitResponseMatrixData file, mapping or instance) plus default alpha,
n_discard and gain. It validates the matrix once on load and publishes its
facts as a read-only layout. pseudo_inverse() returns the Tikhonov- and
truncation-regularised pseudo-inverse, and correct() returns one frozen
corrector step that zeroes the correctors downstream of the last BPM with
beam, plane by plane, together with a Reason saying why it did so. It
reads no hardware.

The test module checks the tool against goldens frozen from the ALS MATLAB
sources (SCgetPinv.m and SCexp_ALS_calcCMstep.m) run in MATLAB
26.1.0.3276743 (R2026a) Update 3 on appsdev2.als.lbl.gov, over the 19
cases in trajectory_cases.json:

  trajectory_goldens.npz  a00777fa45100b887c515ffee265dc641d128b7d1f01972cda42733aece62fef
  trajectory_cases.json   5c98dfb1e64e6d303aa38069d0b56fde2fd364573117813831e9cff72e0243be
  SCgetPinv.m             e35239d6c5cafae8477adfdbccfba6d7c3d65d48d11c3a581de7fbc768575d1f
  calcCMstep.m            592b1a6cf05f7f5889f7b20aac26945ce80c3673e2d581563ac5a9e65a167f78
  MATLAB driver           df9cc13c5986a1922616619f6aefc4488fea4865da0567b6dd3f0d65c908341f

Set PYAML_TRAJECTORY_GOLDENS to test against another goldens file; tests
that need the goldens carry "golden" in their name.
A checkout without tests/tuning_tools/trajectory_goldens.npz now skips the
156 golden tests with a reason instead of erroring, so the module runs on a
tree that does not ship the binary. A file named through
PYAML_TRAJECTORY_GOLDENS stays required: a wrong path still errors.
A plain X.Y.Z tag is upstream's release. Pushing one to the fork must not
publish it under the fork's distribution name.
@thellert

Copy link
Copy Markdown
Author

Landed: apg was moved to this branch's head 35893ba with --force-with-lease and released as 0.3.2.post1 (publish run https://github.com/als-apg/pyaml/actions/runs/39067723584). The previous line stays at tag 0.3.1.post2.

@thellert thellert closed this Oct 17, 2026
@thellert
thellert deleted the sync/upstream-0.3.2 branch October 17, 2026 20:42

This branch was successfully deployed

1 active deployment
pypi — 35893ba9 Deployed Oct 17, 2026 by thellert via deploy #3
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