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

Extract jtor shape function into a class #107

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

timothy-nunn
Copy link
Contributor

@timothy-nunn timothy-nunn commented Mar 11, 2024

Making available some of the changes that removes the hard-coded double power shape function and allows arbitrary shape functions.

We can now use ConstrainPaxisIpArbShape or ConstrainBetapIpArbShape to constrain the profiles with an arbitrary shape_function. By default, these will use the DoublePowerShapeFunction but any class that implements the new ProfileShapeFunction interface will work.

Backwards compatibility ensured by writing the ConstrainBetapIp and ConstrainPaxisIp classes to point at their arbitrary shape counterpart.

Added tests using the existing test_jtor.py to ensure these additions replicate the behaviour of the code before these changes.

Example 01 updated to use the new classes but I don't think updating all of the examples will be necessary--let me know your thoughts on this.

freegs/jtor.py Outdated Show resolved Hide resolved
@ZedThree
Copy link
Collaborator

LGTM!

Co-authored-by: Peter Hill <zed.three@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants