Closed petr-lanl closed 1 year ago
Yes, that's correct - the new version of distgen doesn't have a setter for Generator.input
, in fact that object is now a derived property (the details have to do with Distgen making use of the Pint package to handle physical units internally). I will correct the notebook so that it use the up-to-date Distgen syntax:
gen['x_dist']={'type':'uniform', 'min_x': -0.1unit_registry('m'), 'max_x': +0.1unit_registry('m')}
Thank you, I have now issue with cell 8 as you are using fix=True
option. I believe that it calls for sectormagent_fix
element that I do not have in my GPT install. What kind of element is that?
Removing fix=True
seems to be working as expected.
Finally, class Sectormagnet
has method track_ref
commented out. This causes cell 21 to fail since the fall back method of super
does nothing.
sectormagnet_fix
is an outdated version of the sectormagnet element in GPT - the original sectormagnet code had a bug in it at the time, so we were supplied with a version called "fixed". However, the fixed version is now the standard, so I removed that argument to Sectormagnet.
I also used to have a separate element for Quadrupoles with fringes, however that is also included in GPT (probably for some time), so I'm updated the notebook on quadrupoles.
I found a few more instances that needed updating, but think I caught them all (or most). Please reopen this issue if you find any more.
Ok, I've updated all the notebooks in examples/elements and checked they all run.
examples/elements/sectormagnet.ipynb cell 6 contains:
gen.input['x_dist']={'type':'uniform', 'min_x': -0.1*unit_registry('m'), 'max_x': +0.1*unit_registry('m')}
It assumes that distgen has a setter for property
input
. The version of distgen, which I have, has the setter commented out as a result weak focusing example does not work: instead ofSame holds true for edge focusing part of the notebook