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

Matching fixes #615

Merged
merged 4 commits into from
Jun 14, 2023
Merged

Matching fixes #615

merged 4 commits into from
Jun 14, 2023

Conversation

swhite2401
Copy link
Contributor

Couple bugs were found in the matching module:

  • The ordering of positional and keyword argument in Variable class was wrong and is was not possible to pass args to the set/get functions. args is not set as a keyword with type tuple
  • use_integer option in LinoptConstraint was not working do to a problem with the logic

These are now fixed.

In addition an improved handling of phase advance avoiding modulos in users script not matching integer part of the tune is added. Finally for 2D and 4D linopt calculations, the AtError 'Unstable ring' is caught and sent back as warning, in which case NaN are returned

pyat/at/physics/linear.py Outdated Show resolved Hide resolved
pyat/at/matching/matching.py Outdated Show resolved Hide resolved
@swhite2401
Copy link
Contributor Author

@simoneliuzzo , is this ok for you? You will have to remove the modulo on the desired phase in your matching jobs as discussed yesterday.

Copy link
Contributor

@lfarv lfarv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Nans instead of errors, the rule is not clear. For safety. penalty evaluation functions should be prepared for both possibilities.

@swhite2401
Copy link
Contributor Author

For Nans instead of errors, the rule is not clear. For safety. penalty evaluation functions should be prepared for both possibilities.

True, to be kept in mind for the new matching module

@lfarv lfarv added Python For python AT code bug fix labels Jun 7, 2023
@lfarv lfarv mentioned this pull request Jun 7, 2023
@swhite2401
Copy link
Contributor Author

I just checked with @simoneliuzzo this is ok so I merge it

@swhite2401
Copy link
Contributor Author

@lfarv could you re-approve? I just made some pep8 fixes

@swhite2401 swhite2401 requested a review from lfarv June 13, 2023 07:21
@simoneliuzzo simoneliuzzo removed their request for review June 13, 2023 07:25
Copy link
Contributor

@lfarv lfarv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still ok !

@swhite2401 swhite2401 merged commit 6cc2bbf into master Jun 14, 2023
@swhite2401 swhite2401 deleted the matching_fixes branch June 14, 2023 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix Python For python AT code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants