Skip to content

int_order parameter is not exported by to_dict() method #1332

@egstern

Description

@egstern

For the elements ExactMultipole and ExactCFbend, the to_dict() method does not give the value of the int_order parameter.

>>> import impactx

>>> m_elem = impactx.elements.ExactMultipole(ds=1.0, k_normal=[0.0, 0.01, 0.002\
], k_skew=[0.0, 0.002, 0.0004], int_order=6, mapsteps=6)

>>> dir(m_elem)
['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '_pybind11_conduit_v1_', 'aperture_x', 'aperture_y', 'ds', 'dx', 'dy', 'finalize', 'has_name', 'int_order', 'mapsteps', 'name', 'nslice', 'push', 'rotation', 'to_dict', 'unit']

The int_order parameter is present in the element structure.

>>> m_elem.to_dict()
{'aperture_x': 0.0, 'aperture_y': 0.0, 'ds': 1.0, 'dx': 0.0, 'dy': 0.0, 'k_normal': [0.0, 0.01, 0.002], 'k_skew': [0.0, 0.002, 0.0004], 'mapsteps': 6, 'name': None, 'nslice': 1, 'rotation': 0.0, 'type': 'ExactMultipole', 'unit': 0}

but the int_order value is not in the dict return by the to_dict() method.

The same thing happens with the ExactCFbend element.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions