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

Configure option syntax now only uses dashes #358

Merged
merged 3 commits into from
Feb 7, 2025

Conversation

nusbaume
Copy link
Collaborator

@nusbaume nusbaume commented Feb 6, 2025

Tag name (required for release branches):
Originator(s): nusbaume

Description (include the issue title, and the keyword ['closes', 'fixes', 'resolves'] followed by the issue number):

Fixes #357 - Should convert CAM_CONFIG_OPTS argument syntax to use dashes instead of underscores

Describe any changes made to build system:

All arguments that can be used in the CAM_CONFIG_OPTS XML variable in a CAM-SIMA case's env_build.xml file now use dashes instead of underscores. Also all single-dash config options (e.g. -dyn versus --dyn) have been removed to avoid any confusion as users move from CAM to CAM-SIMA).

Describe any changes made to the namelist: N/A

List any changes to the defaults for the input datasets (e.g. boundary datasets): N/A

List all files eliminated and why: N/A

List all files added and what they do: N/A

List all existing files that have been modified, and describe the changes:
(Helpful git command: git diff --name-status development...<your_branch_name>)

M cime_config/cam_config.py
M cime_config/config_component.xml

  • Convert CAM_CONFIG_OPTS argument syntax to use dashes instead of underscores, and remove single-dash options. Also add an extra comment.

M cime_config/testdefs/testmods_dirs/cam/outfrq_se_cslam_analy_ic/shell_commands

  • Update syntax for regression test that used analytic ICs to now use dashes (--analytic-ic)

M test/unit/test_cam_config.py

  • Fix unit test structure that was using a no-longer-supported single-dash config argument.

If there are new failures (compared to the test/existing-test-failures.txt file),
have them OK'd by the gatekeeper, note them here, and add them to the file.
If there are baseline differences, include the test and the reason for the
diff. What is the nature of the change? Roundoff?

derecho/intel/aux_sima: ALL PASS

derecho/gnu/aux_sima: ALL PASS

If this changes climate describe any run(s) done to evaluate the new
climate in enough detail that it(they) could be reproduced:

CAM-SIMA date used for the baseline comparison tests if different than latest:

@nusbaume
Copy link
Collaborator Author

nusbaume commented Feb 6, 2025

Also wanted to note that I have created a new issue in the CAM-SIMA-docs repo (ESCOMP/CAM-SIMA-docs#6) that indicates the need to add some documentation that lists all of the config options, what they do, and what they map to in the actual python code. I will add that page/section once this PR is merged.

@nusbaume nusbaume self-assigned this Feb 6, 2025
Copy link
Member

@jimmielin jimmielin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nusbaume! I just had one question about the single-dash variant, otherwise it looks great!

@@ -618,16 +622,16 @@ def parse_config_opts(cls, config_opts, test_mode=False):
type=str, required=False, default="",
help="""Name of dycore""")

parser.add_argument("--analytic_ic", "-analytic_ic",
parser.add_argument("--analytic-ic", "-analytic-ic",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we still want to support the single-dash versions (e.g., -analytic-ic) that's similar to current CAM if it has changed (from -analytic_ic to -analytic-ic) anyway?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally think having just the one dash as an option is ok in case someone typos when manually adding the argument, but if you disagree then I am happy to take it out. Just let me know!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I wonder this too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nusbaume! Personally I would be in favor of getting rid of it to have less 'historical' stuff in SIMA that behaves kinda like CAM but not exactly like it (it would be surprising for the user, for example, for -chem something to work like CAM in the future but -analytic_ic to not work). But I am happy either way.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not familiar with CAM. I only mentioned that in the context of the command line interface where you expect with double dash, more descriptive flags, and with a single dash, a quick, shorthand command. (not always though). I didn't know it's from CAM

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jimmielin @boulderdaze those arguments make sense me! I went ahead and removed the single dash options for now (we can always add shorthand options later if desired). I also asked for re-reviews just to make sure everyone is happy, so if you could look over the changes one more time that would be great!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it, thank you!

@nusbaume nusbaume changed the title Config opt syntax fix Configure option syntax update Feb 6, 2025
Copy link
Collaborator

@boulderdaze boulderdaze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

Copy link
Member

@jimmielin jimmielin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@nusbaume nusbaume changed the title Configure option syntax update Configure option syntax update to now only use dashes Feb 7, 2025
@nusbaume nusbaume changed the title Configure option syntax update to now only use dashes Configure option syntax now only uses dashes Feb 7, 2025
@nusbaume nusbaume merged commit 2b81de7 into ESCOMP:development Feb 7, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Tag
Development

Successfully merging this pull request may close these issues.

3 participants