-
Notifications
You must be signed in to change notification settings - Fork 29
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
BugFix: refpts=None in get_lifetime #580
Conversation
@oscarxblanco sorry I overlooked the case where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have checked the call to get_uint32_index(at.All, endpoint=False) and it seems to work as expected for a given ring with 4043 elements
>>> len(ring)
4043
>>> ring.get_uint32_index(at.All, endpoint=False)
array([ 0, 1, 2, ..., 4040, 4041, 4042], dtype=uint32)
>>> ring.get_uint32_index(at.All)
array([ 0, 1, 2, ..., 4041, 4042, 4043], dtype=uint32)
When executing a test example, both options, with or w/o refpts work and write the expected warning message in the standard output refering to zero-length elements in the index list. This is normal behavior.
I was not able to finish the whole momentum aperture calculation due to some segmentation fault. But this seems to be not related to the indexing problem.
Ok so I propose to merge this as it fixes an obvious bug, on the other hand it would be good to understand this segmentation fault, I you have more details could you report it as a separate issue (it is most likely originating from the c part of the code). I usually never run LT calculation for the full lattice but rather on a subset of elements (typically magnets) so it is well possible that for very heavy computations some problems have passed through the various validations. |
@swhite2401 ok, I will report the segmentation fault in another issue. From my side, this fix could be merged. |
PR #577 introduced a bug when
refpts=None
, this PR fixes this issue