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

fix_all() #215

Closed
andrewgiuliani opened this issue Apr 15, 2022 · 5 comments
Closed

fix_all() #215

andrewgiuliani opened this issue Apr 15, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@andrewgiuliani
Copy link
Contributor

fix_all() only fixes the dofs associated to the current Optimizable, and not it's ancestors.

This is confusing when working with, e.g., ScaledCurrent. Calling fix_all() on a ScaledCurrent does not fix the current at all.

After discussing with @florianwechsung, a proposed change would be to introduce a fix_full() or fix_local() to distinguish between these two use cases.

@andrewgiuliani andrewgiuliani added the enhancement New feature or request label Apr 15, 2022
@mbkumar mbkumar mentioned this issue Apr 20, 2022
@landreman
Copy link
Contributor

For other functions and attributes of an Optimizable object, full refers to "including both fixed and free dofs" rather than "including ancestors". See e.g. https://simsopt.readthedocs.io/en/latest/optimizable.html#function-reference. The proposed fix_full would break this pattern so maybe we should find a different name. Looking at the table of other functions, the pattern is to have local_ in front of functions that exclude ancestors and to have no prefix in front of functions that include ancestors. That means the names that would best preserve the pattern would be fix_all() when including ancestors and local_fix_all() when excluding ancestors.

@andrewgiuliani @florianwechsung @mbkumar what do you think?

Sorry I didn't catch this sooner.

@mbkumar
Copy link
Collaborator

mbkumar commented Apr 21, 2022

Yes, fix_full is breaking the naming conventions employed. @landreman, I like your proposal. An alternative would be fix_global and fix_local.

@andrewgiuliani
Copy link
Contributor Author

I like Matt's proposal

@mbkumar
Copy link
Collaborator

mbkumar commented Apr 25, 2022

Fixed in #222

@mbkumar mbkumar closed this as completed Apr 25, 2022
@mbkumar
Copy link
Collaborator

mbkumar commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants