Skip to content

fix bug at sextupoles ramp#321

Open
Gabrielrezende-asc wants to merge 1 commit intomasterfrom
fix-sextupoles-errors-random-machines
Open

fix bug at sextupoles ramp#321
Gabrielrezende-asc wants to merge 1 commit intomasterfrom
fix-sextupoles-errors-random-machines

Conversation

@Gabrielrezende-asc
Copy link
Contributor

No description provided.

Comment on lines +816 to +824
sx_tot_stren = _pyaccel.lattice.get_attribute(
mod, 'SL', sx_idx
)
sx_error_stren = sx_tot_stren - (step) * sx_stren / nr_steps
_pyaccel.lattice.set_attribute(
mod, 'SL', sx_idx, (step + 1) * sx_stren / nr_steps
mod,
'SL',
sx_idx,
(step + 1) * sx_stren / nr_steps + 1 * sx_error_stren,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I didn't understand what was the bug before, but isn't this new code you implemented equivalent to the one below?

Suggested change
sx_tot_stren = _pyaccel.lattice.get_attribute(
mod, 'SL', sx_idx
)
sx_error_stren = sx_tot_stren - (step) * sx_stren / nr_steps
_pyaccel.lattice.set_attribute(
mod, 'SL', sx_idx, (step + 1) * sx_stren / nr_steps
mod,
'SL',
sx_idx,
(step + 1) * sx_stren / nr_steps + 1 * sx_error_stren,
sx_stren_now = _pyaccel.lattice.get_attribute(
mod, 'SL', sx_idx
)
_pyaccel.lattice.set_attribute(
mod,
'SL',
sx_idx,
sx_stren / nr_steps + sx_stren_now,

If yes, I think this version is simpler, isn't it?

Comment on lines +871 to +877
sx_tot_stren = _pyaccel.lattice.get_attribute(mod, 'SL', sx_idx)
sx_error_stren = sx_tot_stren - (step) * sx_stren / nr_steps
_pyaccel.lattice.set_attribute(
mod, 'SL', sx_idx, (step + 1) * sx_stren / nr_steps
mod,
'SL',
sx_idx,
(step + 1) * sx_stren / nr_steps + 1 * sx_error_stren,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here.

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.

2 participants