-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add writer style option to SettingsWriter pt1 #924
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…e if user supplies empty settings file while speficying writing style as medium
…iter_style_pt1
keckler
approved these changes
Oct 5, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful. I love it. Only a few very piddly comments.
jakehader
requested changes
Oct 5, 2022
jakehader
approved these changes
Oct 5, 2022
…and underscore for an unused variable)
john-science
approved these changes
Oct 5, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love the test coverage!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE: the updates to the original PR on this topic requested by @keckler will be in a follow-up PR, namely making this argument available to
clone
/writeInputs
.Description
As described in Issue #897, we would like a third option that preserves the original settings file even if a setting defined in it is a default value. Currently,
short
removes all settings that have the default value, andfull
prints out every possible setting to the file.To accomplish that, I added a
medium
style option toSettingsWriter
(which involved editing the handling of the strings of "acceptable" styles to constant strings as well as a helper function in thecaseSettings
module calledgetSettingSetByUser
so the full list of user defined settings can be tracked.).I made the
settingsWriteStyle
flag available to themodify
EntryPoint, so one can alter the writing style from the command line.The testing was a little difficult.
writeToYamlFile
method andSettingsWriter
class aren't explicitly tested. I have the 3 writing style options tested, the new method (getSettingsSetByUser
) incaseSettings.py
is tested, and a sad attempt at adding this to themodify
CLI testing.Checklist
doc/release/0.X.rst
) are up-to-date with any bug fixes or new features.doc
folder.setup.py
.