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

Use jinja templates instead of @VARNAME@ in config files #3411

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

aerorahul
Copy link
Contributor

Description

This PR:

  • replaces the template pattern used in configs e.g. @MACHINE@ in config.base with jinja template pattern {{ MACHINE }}
  • setup_expt.py script is updated to remove custom code that was written to search and replace @VARNAME@ with values from the experiment yamls. Jinja provides a much cleaner way to interface those two.
  • updated configs that are jinja templates now have an extension of .j2 in parm/config/<system> directory. e.g. config.base is now named config.base.j2 in parm/config/gfs. It gets rendered as config.base in the experiment directory after setup_expt.py completes the execution.

In addition, this PR also:

  • improves logging of create_experiment.py, setup_expt.py and setup_xml.py.

Type of change

  • Maintenance (code refactor, clean-up, new CI test, etc.)

Change characteristics

  • Is this a breaking change (a change in existing functionality)? NO
  • Does this change require a documentation update? NO
  • Does this change require an update to any of the following submodules? NO

How has this been tested?

Experiment directories were created before and after this change and compared. Changes were in the expected places where template patterns were updated.

Checklist

  • Any dependent changes have been merged and published
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have documented my code, including function, input, and output descriptions
  • My changes generate no new warnings
  • New and existing tests pass with my changes
  • This change is covered by an existing CI test or a new one has been added
  • Any new scripts have been added to the .github/CODEOWNERS file with owners
  • I have made corresponding changes to the system documentation if necessary

…dd workflow/requirements.txt for easy creation of workflow virtual env. ignore the venv in HOMEgfs space. use detect_machine.sh in global-workflow instead of relying on the gfs-utils submodule
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

ShellCheck found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

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