-
Notifications
You must be signed in to change notification settings - Fork 2
Python-ize the remaining bash run scripts, parallelize more tasks, fix some bugs #33
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
base: develop
Are you sure you want to change the base?
Changes from all commits
b4b2764
9e84507
b9a1112
110875c
0d1082d
363e15f
75d66cc
1067176
57283a6
18aa8d9
b7477d0
2d74ee9
ddf8f8b
6314e52
7746d97
562d342
cf20e25
0654972
84e9e20
8be5b48
99175bc
87613b5
f5cffd2
6ef4227
2b426c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,8 @@ sections=( | |
| for sect in ${sections[*]} ; do | ||
| source_yaml ${GLOBAL_VAR_DEFNS_FP} ${sect} | ||
| done | ||
| # Sets up PYTHONPATH and VERBOSE environment variables | ||
| . $USHdir/set_job_env.sh | ||
| # | ||
| #----------------------------------------------------------------------- | ||
| # | ||
|
|
@@ -52,17 +54,21 @@ scrfunc_fp=$( $READLINK -f "${BASH_SOURCE[0]}" ) | |
| scrfunc_fn=$( basename "${scrfunc_fp}" ) | ||
| scrfunc_dir=$( dirname "${scrfunc_fp}" ) | ||
|
|
||
| print_info_msg " | ||
| printf " | ||
| ======================================================================== | ||
| Entering script: \"${scrfunc_fn}\" | ||
| In directory: \"${scrfunc_dir}\" | ||
| ========================================================================" | ||
| # | ||
| # Call the run script | ||
| # | ||
| $SCRIPTSdir/check_post_output.sh || \ | ||
| python $SCRIPTSdir/check_post_output.py ${VERBOSE_FLAG} \ | ||
|
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. Values that were previously read in from environment variables in the bash scripts are now explicitly passed as command-line arguments |
||
| --config="${GLOBAL_VAR_DEFNS_FP}" \ | ||
| --cycle_date="${YYMMDD}${HH}" \ | ||
| ${ENSMEM_ARG} || \ | ||
| print_err_msg_exit "\ | ||
| Call to script \"check_post_output.sh\" from \"${scrfunc_fn}\" failed." | ||
| Call to \"check_post_output.py\" from \"${scrfunc_fn}\" failed." | ||
|
|
||
| # | ||
| #----------------------------------------------------------------------- | ||
| # | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,8 @@ sections=( | |
| for sect in ${sections[*]} ; do | ||
| source_yaml ${GLOBAL_VAR_DEFNS_FP} ${sect} | ||
| done | ||
| # Sets up PYTHONPATH, ACCUM_ARG, ENSMEM_ARG, and VERBOSE environment variables | ||
| . $USHdir/set_job_env.sh | ||
|
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. In addition to |
||
| # | ||
| #----------------------------------------------------------------------- | ||
| # | ||
|
|
@@ -50,15 +52,24 @@ scrfunc_fp=$( $READLINK -f "${BASH_SOURCE[0]}" ) | |
| scrfunc_fn=$( basename "${scrfunc_fp}" ) | ||
| scrfunc_dir=$( dirname "${scrfunc_fp}" ) | ||
|
|
||
| print_info_msg " | ||
| printf " | ||
| ======================================================================== | ||
| Entering script: \"${scrfunc_fn}\" | ||
| In directory: \"${scrfunc_dir}\" | ||
| ========================================================================" | ||
| # | ||
| # Call the run script | ||
| # | ||
| $SCRIPTSdir/pcpcombine.sh || \ | ||
| python $SCRIPTSdir/pcpcombine.py ${VERBOSE_FLAG} \ | ||
| --config="${GLOBAL_VAR_DEFNS_FP}" \ | ||
| --cycle_date="${YYMMDD}${HH}" \ | ||
| --field_group="${FIELD_GROUP}" \ | ||
| --fcst_or_obs="${FCST_OR_OBS}" \ | ||
| --obs_dir="${OBS_DIR}" \ | ||
| --obtype="${OBTYPE}" \ | ||
| --fcst_level="${FCST_LEVEL}" \ | ||
| --fcst_thresh="${FCST_THRESH}" \ | ||
| ${ACCUM_ARG} ${ENSMEM_ARG} || \ | ||
| print_err_msg_exit "\ | ||
| Call to \"pcpcombine.sh\" from \"${scrfunc_fn}\" failed." | ||
| Call to \"pcpcombine.py\" from \"${scrfunc_fn}\" failed." | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -221,7 +221,7 @@ OBS_{{METPLUS_TOOL_NAME}}_WINDOW_END = {OBS_WINDOW_END} | |
| {#- | ||
| Import the file containing jinja macros. | ||
| #} | ||
| {%- import metplus_templates_dir ~ '/metplus_macros.jinja' as metplus_macros %} | ||
| {%- import 'metplus_macros.jinja' as metplus_macros %} | ||
|
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. For some reason the old syntax doesn't work in the python context. This has no change in functionality. |
||
|
|
||
| {#- | ||
| Jinja requires certain variables to be defined globally within the template | ||
|
|
||
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.
Per #15, this function has been deprecated.
printfgives more analogous functionality to the old function (which calledprintfinternally), particularly with regards to newlines, so using that instead ofecho