Python-ize the remaining bash run scripts, parallelize more tasks, fix some bugs#33
Open
mkavulich wants to merge 25 commits into
Open
Python-ize the remaining bash run scripts, parallelize more tasks, fix some bugs#33mkavulich wants to merge 25 commits into
mkavulich wants to merge 25 commits into
Conversation
Converts all four remaining shell scripts in scripts/ to Python, completing the bash-to-Python migration: - check_post_output.py: calls set_leadhrs() to verify post-processed forecast output files exist within the allowed missing-file threshold - gridstat_or_pointstat_ensmean.py: GridStat/PointStat on ensemble mean output from GenEnsProd - gridstat_or_pointstat_ensprob.py: GridStat/PointStat on ensemble probability output from GenEnsProd - genensprod_or_ensemblestat.py: GenEnsProd or EnsembleStat with per-member forecast template list; GenEnsProd skips obs file check - pcpcombine.py: PcpCombine for FCST or OBS with double set_leadhrs call pattern; includes PM2.5/PM10 USER_DEFINED combine logic for AIRNOW Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
grep -q exits immediately on first match, closing the pipe before conda env list finishes writing. Conda's Python runtime catches the resulting SIGPIPE and prints a noisy error report to stderr. Adding 2>/dev/null suppresses it without affecting the grep result or exit code. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s requires a string-subst dictionary in check_post_output.py; should be able to get rid of this logic in all scripts by the end. - Convert ENS_TIME_LAG_HRS to a true Python list. This removes need for strange "literal_eval" logic in gridstat_or_pointstat.py
…t; almost working
…h for ACCUM_HH definitions
…e an ensemble member index and some don't, so we need to add this as another optional variable to set_job_env.sh
…tion: section with tasks_per_node, walltime, and memory, as well as a TASKS: variable. Update some WE2E tests to use more parallelism
…execution: section with tasks_per_node, walltime, and memory, as well as a TASKS: variable, and apply memory and task settings to workflow definition file'
…place with printf
…_dir_file(), check_var_valid_value(), get_elem_inds(), is_element_of(), print_input_args(), and process_args()
mkavulich
force-pushed
the
feature/pythonize_remaining_bash
branch
from
July 17, 2026 19:37
76aef47 to
87613b5
Compare
mkavulich
marked this pull request as ready for review
July 17, 2026 19:45
mkavulich
requested review from
EdwardSnyder-NOAA,
JeffBeck-NOAA and
gsketefian
as code owners
July 17, 2026 19:45
This was referenced Jul 19, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
DESCRIPTION OF CHANGES:
While this touches a lot of files and changes a lot of lines, this is actually a fairly simple PR:
Bash --> Python conversion and parallelism
The remaining bash run scripts are now converted to Python. With this change, I have some demonstrations of the new functionality and cleanup that this allows:
MET_ensemble_verification_only_vx_time_lagthat went from requiring more than 4 hours on Ursa to around 50 minutes, mostly due to speedup of therun_MET_GenEnsProd_vx_UPAandrun_MET_GenEnsProd_vx_SFCtasks. Running all WE2E tests now takes just over an hour on Ursa, this could be sped up further by decreasing the--delayoption and staging some obs data (Need to pre-stage some observations for WE2E tests to make them go quicker #30).ENS_TIME_LAG_HRSas an example, and it already removed the need for a python package (ast) and a few lines of logic.Bugs fixed
ush/set_vx_params.shand the convertedush/set_vx_params.pythat resulted in APCP and ASNOW verification tasks missing anhafter the number of accumulated hours in both the job name and filenames for GridStat. This has been corrected.Type of change
ush/launch_vx_wflow.shand job scripts, so I believe there should be no loss of user-facing functionality.TESTS CONDUCTED:
Ran all WE2E tests on Ursa. Used George's new regression testing functionality to compare the before-and-after performance and results. I confirmed all WE2E tests produced bit-for-bit identical results, with the only differences being in filenames due to the above-mentioned GridStat filename fix (I renamed all APCP and ASNOW GridStat output files manually to the old names in my test directory to ensure the regtest diff script would return "Success").
DEPENDENCIES:
[develop]: Add regression testing #28mergedDOCUMENTATION:
Documentation was not updated with this PR, but almost all user-facing functionality remains identical. Will need to do a final dedicated push to update documentation in a future PR (tracked in #4)
ISSUE:
print_info_msg()bash function not working #15CONTRIBUTORS:
A few commits in this PR were authored, partially or in full, by Claude CLI. These commits include the specific model used as a co-author. All of these changes were manually reviewed by me and checked for correctness.