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

always use PhysConstSI in parser #978

Merged
merged 3 commits into from
Jun 19, 2023

Conversation

SeverinDiederichs
Copy link
Member

@SeverinDiederichs SeverinDiederichs commented Jun 14, 2023

Previously, the constants such as clight etc in the parser were chosen according to the unit system. However, that prevents the most prevalent use case, where quantities in SI units (such as beam width or emittance) can be transformed into normalized units using the parser and the constants. This did not work because then the constants would also be normalized.

I don't see any use case, where normalized constants are needed (they can simply be omitted).

  • Small enough (< few 100s of lines), otherwise it should probably be split into smaller PRs
  • Tested (describe the tests in the PR description)
  • Runs on GPU (basic: the code compiles and run well with the new module)
  • Contains an automated test (checksum and/or comparison with theory)
  • Documented: all elements (classes and their members, functions, namespaces, etc.) are documented
  • Constified (All that can be const is const)
  • Code is clean (no unwanted comments, )
  • Style and code conventions are respected at the bottom of https://github.com/Hi-PACE/hipace
  • Proper label and GitHub project, if applicable

@SeverinDiederichs SeverinDiederichs added unit system handling of both SI and normalized units options non-backward-compatible Changes the behavior of the code, old input file may give different results labels Jun 14, 2023
Copy link
Member

@MaxThevenet MaxThevenet left a comment

Choose a reason for hiding this comment

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

Thanks for this PR!

@MaxThevenet MaxThevenet merged commit 21c38b1 into Hi-PACE:development Jun 19, 2023
@SeverinDiederichs SeverinDiederichs deleted the parser_const_SI branch June 20, 2023 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-backward-compatible Changes the behavior of the code, old input file may give different results unit system handling of both SI and normalized units options
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants