Repository navigation
Add Change, Set and Single Mode windows - #18
Merged
Merged
Conversation
- Change: form for "change element | variable | particle_start | tune | z_tune" with the add/@/d/% modes, a command preview, Tao's report shown in the window, and "Use selected" for the selected element. - Set: the pipe-reported groups (global, bmad_com, beam, beam_init, space_charge_com, ptc_com, opti_de_param) as editable parameter tables, plus a free-form "set <subcommand> ..." line with history. - Single Mode: the key-bound variables in banks of ten, stepped with buttons or Tao's single-mode keys; delta scaling; save/restore. Commands are built the way the current Tao accepts them: switches after the change subcommand, and no space after the d/% prefixes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three new windows, each in the Tao menu, in the Main window's toolbar and in the Window menu (Ctrl+6, Ctrl+7, Ctrl+8).
Change (
changecommand)@), design + (d), or percent (%).branch>>index, becausechange ele QF ...would change every QF.Set (
setcommand)pipe: global, bmad_com, beam, beam_init, space_charge_com, ptc_com, opti_de_param.set <group> <parameter> = <value>. Arrays are shown and set space separated (e.g.d_orb).set <subcommand> <arguments>for every other subcommand (element, tune, plot, lattice, …), with a saved history. Picking an entry fills in both fields.Single Mode (key-bound variables)
Table: the variables bound to keys (
key_bound,key_delta), in banks of ten as in Tao's single mode, with columns Keys, Variable, Element[attribute], Model, Saved and Delta, plus −10/−1/+1/+10 buttons.Keys (while the window has focus), the same as Tao's single mode:
1…0/q…p!…)/Q…P)</>How a step is done: it sets the model value directly, as Tao's single mode does.
change varwould also rebuild the optimizer's derivative matrix on every key press.Save / Restore saved: the values start as Tao's
key_val0. The window keeps its own saved values becausekey_val0can't be set from the command line.Tao issues found (worked around here, not fixed)
change -mask Q1* tune …,change -branch … z_tune …andchange -silent variable …, as written in the manual, are rejected ("Change who?"). Tao only looks for switches from the second word on. The GUI puts switches after the subcommand.change ele q k1 d 0.1and… % 10(with a space, as in the manual) give "Expression is blank" and change nothing. The GUI writesd0.1/%10.change … %50is computed in single precision (0.32 → 0.4799999964).key_val0: it can't be set withset var.Testing
tests/test_tools.py:n_opti_cycles, editing thed_orbarray, every group loading, the free-form line, Tao's rejection, and the history;🤖 Generated with Claude Code