-
Notifications
You must be signed in to change notification settings - Fork 130
[develop] Integrate UW CLI tool for templater and remove external dependency. #994
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
Merged
MichaelLueken
merged 7 commits into
ufs-community:develop
from
christinaholtNOAA:update_templater
Jan 11, 2024
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cee87f1
Removing workflow-tools and PYTHONPATH solution
christinaholtNOAA 103cf81
Initial attempt to remove templater
christinaholtNOAA 347e81f
Linting.
christinaholtNOAA ed18093
Cleaning up logging and temp files.
christinaholtNOAA cbabab1
Finish alphabetizing imports.
christinaholtNOAA b1feb33
Oops.
christinaholtNOAA 0eba9d3
Addressing review comments from Mike K.
christinaholtNOAA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -388,31 +388,30 @@ settings="\ | |
| 'field_thresholds': '${FIELD_THRESHOLDS:-}' | ||
| " | ||
|
|
||
| # Store the settings in a temporary file | ||
| # Render the template to create a METplus configuration file | ||
| tmpfile=$( $READLINK -f "$(mktemp ./met_plus_settings.XXXXXX.yaml)") | ||
| cat > $tmpfile << EOF | ||
| $settings | ||
| EOF | ||
| # | ||
| # Call the python script to generate the METplus configuration file from | ||
| # the jinja template. | ||
| # | ||
| python3 $USHdir/python_utils/workflow-tools/scripts/templater.py \ | ||
| -c "${tmpfile}" \ | ||
|
|
||
| uw template render \ | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change was made in several of the ex-scripts. This is how the command line tool can be called to render a template instead of relying on a script on disk. |
||
| -i ${metplus_config_tmpl_fp} \ | ||
| -o ${metplus_config_fp} || \ | ||
| print_err_msg_exit "\ | ||
| Call to workflow-tools templater to generate a METplus | ||
| configuration file from a jinja template failed. Parameters passed | ||
| to this script are: | ||
| Full path to template METplus configuration file: | ||
| metplus_config_tmpl_fp = \"${metplus_config_tmpl_fp}\" | ||
| Full path to output METplus configuration file: | ||
| metplus_config_fp = \"${metplus_config_fp}\" | ||
| Full path to configuration file: | ||
| ${tmpfile} | ||
| " | ||
| -o ${metplus_config_fp} \ | ||
| -v \ | ||
| --values-file "${tmpfile}" | ||
|
|
||
| err=$? | ||
| rm $tmpfile | ||
| if [ $err -ne 0 ]; then | ||
| message_txt="Error rendering template for METplus config. | ||
| Contents of input are: | ||
| $settings" | ||
| if [ "${RUN_ENVIR}" = "nco" ] && [ "${MACHINE}" = "WCOSS2" ]; then | ||
| err_exit "${message_txt}" | ||
| else | ||
| print_err_msg_exit "${message_txt}" | ||
| fi | ||
| fi | ||
| # | ||
| #----------------------------------------------------------------------- | ||
| # | ||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
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.
PYTHONPATH shenanigans are no longer needed. In fact, they cause problems when trying to call the command line tools from the conda environment.