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

Switch to MpasConfigParser for config options #873

Merged
merged 12 commits into from
Apr 20, 2022

Conversation

xylar
Copy link
Collaborator

@xylar xylar commented Apr 20, 2022

This merge switches to using the MpasConfigParser from MPAS-Tools (MPAS-Dev/MPAS-Tools#460). This class has functionality that will be useful in MPAS-Analysis and compass, as well as potentially other tools in the future. The new functionality in MPAS-Analysis is that comments are preserved in the config file written out to the HTML directory and that there is an additional "source" comment for each config option telling the user where it came from. This should hopefully help folks to better understand how config options are built up from multiple sources.

Some significant refactoring of the code was required. The getWtihDefault() method is not available in MpasConfigParser, as that has proved to be confusing. It is better to have a default value for the config option in default.cfg than hidden in the code. A few defaults were missing and have been added to default.cfg.

The method getExpression() has been renamed to getexpression() to be more consistent with other methods in the config parser (getint(), getboolean(), etc.).

@xylar
Copy link
Collaborator Author

xylar commented Apr 20, 2022

Testing

I ran the test suite on Anvil. All tests finished successfully. Results are here:
https://web.lcrc.anl.gov/public/e3sm/diagnostic_output/ac.xylar/analysis_testing/anvil/use_mpas_config_parser/

@xylar
Copy link
Collaborator Author

xylar commented Apr 20, 2022

While there is certainly room for additional testing, I plan for that to happen before the next release.

@xylar xylar merged commit a7b282e into MPAS-Dev:develop Apr 20, 2022
@xylar xylar deleted the use_mpas_config_parser branch April 20, 2022 10:33
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.

1 participant