Skip to content

problem with display of correctly initialised VariableMultipole element #751

@lcarver

Description

@lcarver

I initalise a VariableMultipole element

var = at.VariableMultipole('h_acd', AmplitudeB = [0.0, 0.0, 1e-6], FuncB=kick_list, MaxOrder=2, Periodic=True, mode=ACMode.ARBITRARY)
In ipython, python interactive shell or with python script.py, if I run print(var) I get the correct output.

In ipython or an interactive python shell:

var

returns an error saying AmplitudeA or AmplitudeB must be defined. It seems like at some point when generating the string to print in the interactive shells it calls the init again which creates the error.

Full test script is pasted below.


import at
import numpy as np
from at import ACMode

ring = at.load_mat('/machfs/carver/Repo/EBSlattices/AT/S28F.mat', mat_key='LOW_EMIT_RING_INJ')

ring.disable_6d()
qx,qy = ring.get_tune()


Nturns = 1000

kick_list = np.sin(2*np.pi*np.arange(Nturns)*(qx))

var = at.VariableMultipole('h_acd', AmplitudeB = [0.0, 0.0, 1e-6], FuncB=kick_list, MaxOrder=2, Periodic=True, mode=ACMode.ARBITRARY)
var

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions