desy-ml / cheetah

Fast and differentiable particle accelerator optics simulation for reinforcement learning and optimisation applications.
https://cheetah-accelerator.readthedocs.io
GNU General Public License v3.0
28 stars 13 forks source link

Improved Documentation #23

Closed FelixTheilen closed 1 year ago

FelixTheilen commented 1 year ago

This pull request has been redesigned to specifically adress issue https://github.com/desy-ml/cheetah/issues/2 . -The pull request introduces a new comment on the 'init' function. This will help finding the definitions for the parameters. -Also a new comment on the 'transfer_map' function has been added, explaining the general purpose as well as the state vector and parameters, returns and raises. -The parameter 'energy' has been removed from various classes. The parameter 'energy' is passed on through the beam passed to the segment. It is therefore not changeable by the user, when trying to control the beam, e.g. you can't call the function HorizontalCorrector and pass a parameter energy to this function. This parameter is defined, when the beam is fed in the Segment. -'repr' has now a short comment describing the use of this function. -Spelling mistakes have been corrected in accelerator.py and particles.py.

cr-xu commented 1 year ago

Hi, I marked the PR as draft. Once all changes are made and pushed, you can mark it as ready and ask for review/merge.

jank324 commented 1 year ago

@FelixTheilen I think it makes sense to split this pull request into three:

FelixTheilen commented 1 year ago

This pull request has been redesigned to specifically adress issue #2 . -The pull request introduces a new comment on the 'init' function. This will help finding the definitions for the parameters. -Also a new comment on the 'transfer_map' function has been added, explaining the general purpose as well as the state vector and parameters, returns and raises. -The parameter 'energy' has been removed from various classes. The parameter 'energy' is passed on through the beam passed to the segment. It is therefore not changeable by the user, when trying to control the beam, e.g. you can't call the function HorizontalCorrector and pass a parameter energy to this function. This parameter is defined, when the beam is fed in the Segment. -'repr' has now a short comment describing the use of this function. -Spelling mistakes have been corrected in accelerator.py and particles.py.

FelixTheilen commented 1 year ago

I reused the branch needed for the improvement of the documentation. This resulted in this pull request not changing anything in the desy-ml/master file. Unfortunately this couldnt be reverted, as i had the previous file, but i could'nt update since Github thought the removal of items made the master branch more up to date.