Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: property 'radiation_flag' of 'RBend' object has no setter #595

Closed
nat93 opened this issue Feb 13, 2025 · 2 comments
Closed

Comments

@nat93
Copy link

nat93 commented Feb 13, 2025

Dear Xsuite Developers,
I would greatly appreciate it if you could help me to solve the problem I am facing now with Xsuite.

1. I load the lattice of the electron ring from made into Xsuite:

mad = Madx()
mad.call(made_file_name)
mad.use(sequence="ring")

2. Slice thick elements using Teapot strategy

Strategy = xt.slicing.Strategy
Teapot = xt.slicing.Teapot
 slicing_strategies = [
            Strategy(slicing=None),  # Default applied to all elements
            Strategy(slicing=Teapot(3), element_type=xt.Sextupole),  # For all sextupoles
            Strategy(slicing=Teapot(3), element_type=xt.Bend),  # For all sbend dipoles
            Strategy(slicing=Teapot(3), element_type=xt.RBend),  # For all rbend dipoles
            Strategy(slicing=Teapot(20), element_type=xt.Quadrupole),  # For all quads
        ]
line.slice_thick_elements(slicing_strategies=slicing_strategies)

Please note that here I already use RBend (previously I only used Bend).
3. Turn on RF
4. Turn on SR --> got the error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
line.configure_radiation(model="mean")

File [~/miniforge3/envs/xsuite_env/lib/python3.12/site-packages/xtrack/line.py:2982](http://localhost:8888/~/miniforge3/envs/xsuite_env/lib/python3.12/site-packages/xtrack/line.py#line=2981), in Line.configure_radiation(self, model, model_beamstrahlung, model_bhabha, mode)
   2980         continue
   2981     if hasattr(ee, 'radiation_flag'):
-> 2982         ee.radiation_flag = radiation_flag
   2984 for kk, ee in self.element_dict.items():
   2985     if hasattr(ee, 'flag_beamstrahlung'):

AttributeError: property 'radiation_flag' of 'RBend' object has no setter

Could you help me please to resolve this issue?
Previously I did not have this problem only after reinstalling Xsuite today (Feb-13, 2025).
Thank you in advance.

@nat93
Copy link
Author

nat93 commented Feb 14, 2025

Following this new PR: #596

@nat93
Copy link
Author

nat93 commented Mar 25, 2025

Solved: #596 (comment)

@nat93 nat93 closed this as completed Mar 25, 2025
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

No branches or pull requests

1 participant