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

Improve Beam docstrings and type hints #284

Merged
merged 7 commits into from
Nov 20, 2024

Conversation

Hespe
Copy link
Member

@Hespe Hespe commented Oct 22, 2024

Description

The outdated docstrings and properties are adjusted to match the new naming scheme.
In addition, Beam is converted into an abstract class, increasing the probability to catch such issues early.

(The old mu_s property of Beam is renamed to mu_tau.)

Motivation and Context

The beam coordinate system has been adjusted recently, leaving some outdated docstrings in the Beam class and its subclasses ParameterBeam and ParticleBeam.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)

Checklist

  • I have updated the changelog accordingly (required).
  • My change requires a change to the documentation.
  • I have updated the tests accordingly (required for a bug fix or a new feature).
  • I have updated the documentation accordingly.
  • I have reformatted the code and checked that formatting passes (required).
  • I have have fixed all issues found by flake8 (required).
  • I have ensured that all pytest tests pass (required).
  • I have run pytest on a machine with a CUDA GPU and made sure all tests pass (required).
  • I have checked that the documentation builds (required).

Note: We are using a maximum length of 88 characters per line.

@Hespe Hespe added the documentation Improvements or additions to documentation label Oct 22, 2024
@Hespe
Copy link
Member Author

Hespe commented Oct 22, 2024

I had planned on changing from_parameters() and from_twiss() to use the same default number of particles for ParticleBeam. However, some tests rely on the old behaviour, so I reverted that change for now.

@Hespe Hespe requested a review from jank324 October 22, 2024 11:08
@Hespe Hespe mentioned this pull request Oct 28, 2024
14 tasks
@jank324 jank324 merged commit de3c956 into desy-ml:master Nov 20, 2024
8 checks passed
@Hespe Hespe deleted the 279-beam-properties branch November 21, 2024 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Outdated property in Beam class Misleading docstring and type hints in beam class methods
2 participants