Feature #3218 warn overwrite, #2110 fail if output exists - #3332
Feature #3218 warn overwrite, #2110 fail if output exists#3332georgemccabe wants to merge 57 commits into
Conversation
…ing overwritten, indicating that a misconfiguration is present. Pass list of outputs to the next wrapper in the process list so it can properly check if multiple instances are writing to the same path. Move logic to run processes into a function that can be called by unit tests to test behavior from running multiple processes, e.g. multiple instances of the same wrapper.
…t a duplicate file path is being overwritten
…re being overwritten
…sting various scenarios such as: 2 fields processed separately, runtime freq doesn't match output template, custom loop list, and multiple instances. This includes updated test logic to properly test multiple PROCESS_LIST items instead of creating/calling a single wrapper/process as many test do. Consider adding a fixture to easily handle the config and process list initialization that can be resused in many tests
…m templates for each of the RUNTIME_FREQ settings
…sues by changing the output template and/or prefix
…ric variables are not set
…multiple wrappers at once and 2) skip steps specific to MET config variables
…dd to warning message with info on how to disable it
…nings when output is written more than once in a single METplus run
… encountered. This setting coupled with the new logic to warn if output has already been generated within a given METplus run will cause a run to fail in this case. Note that this does not warn/fail if the output already exists on disk from a previous run
…ee which use cases currently output a warning log
…g pytests from top-level directory
…lid behavior to read skip lead seq setting and skip if set
…write is expected
… RegridDataPlane wrapper
…uld resolve the redundant run
…me valid is processed more than once based on the configuration and it doesn't need to be run multiple times
…s when a warning occurs and EXIT_ON_WARN=True
… output a warning when the output file attempted to be written already exists on disk. Coupled with EXIT_ON_WARN, this accomplishes the desired behavior in issue #2110
…init and running processes. Note currently EXIT_ON_WARN is only supported on the global level and is read upon initial METplusConfig initialization, so the test had to be written to set this config setting before initializating the config.
… a warning log is still output if SKIP_IF_OUTPUT_EXISTS is not set
Coverage Report for CI Build 33924738465Coverage increased (+0.1%) to 92.133%Details
Uncovered Changes
Coverage Regressions1 previously-covered line in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
… can be overridden for a single use case
…d WARN_IF_ config naming conventions
…sed variables to appease SQ
…an ensemble member is not found. Also added ability to specify a subset of wrappers to support a WARN_IF_ config variable so only EnsembleStat and GenEnsProd support the new config
There was a problem hiding this comment.
I approve of these changes.
There are changes to 84 files, which is a lot to review. Although I realize that many are minor changes in .conf files, adding commented out entries for
{MET_TOOL}_WARN_IF_DUPLICATE_OUTPUT =
{MET_TOOL}_WARN_IF_OUTPUT_EXISTS =
I see that all of the GHA tests passed (other than the expected diffs and linkcheck failures), which is great. Thanks for adding new tests.
I inspected the file diffs flagged by the GHA testing workflow and confirmed that they're the changes you describe.
I see new entries in the docs (https://metplus--3332.org.readthedocs.build/en/3332/Users_Guide/glossary.html) for the new configuration options. You could consider starting a running list of config file changes for METplus-13.0.0 in the METplus Wrappers Upgrade Instructions section... rather than compiling a list prior to METplus-13.0.0 going out the door.
I have not manually replicated all of the situations that trigger these warnings to confirm that it behaves exactly as described. So there's some risk there. Please LMK if you'd rather I do a more in-depth review, and perhaps we could schedule a working meeting to demonstrate each situation.
Change Summary
WARN_IF_DUPLICATE_OUTPUT(when the same output is written within the same METplus run) and wrapper-specific config options -- wrt Create WARNING message for operations that overwrite output files #3218WARN_IF_OUTPUT_EXISTS(when output already exists on disk) and wrapper-specific config options -- wrt Add config option to fail if output already exists #2110EXIT_IF_WARNconfig option to end METplus run immediately when a warning log is encountered (note: issue Enhancement: Support wrapper-specific EXIT_ON_WARN config options #3333 was created for adding support for wrapper-specific options) -- wrt Add config option to fail if output already exists #2110WARN_IF_ENSEMBLE_IS_MISSINGto disable warnings when an ensemble member is not found for GenEnsProd and/or EnsembleStatEXIT_ON_WARNfor all use case tests, requiring that all warnings be resolved or ignored for use cases added to the repositoryadd_met_config_helper.pyscript to help add config support (documentation, basic use case conf updates, etc.) for all (or multiple) wrappers and for non-MET config variables (skips steps specific to MET tools)Pull Request Testing
Added unit tests to demonstrate expected behavior
review code changes under
metplusdirectory and unit tests underinternal/tests/pyteststo confirm correctness. Review use case diffs (see below)review documentation changes - Are the new configs named well? Should there be a new section in the User's Guide (under Configuration chapter?) to describe warning, config variables to skip certain warnings, and exiting when a warning is encountered? (this could be added in final dev cycle)
Unless review suggests adding more
Do these changes include sufficient testing updates? [Yes]
Will this PR result in changes to the test suite? [Yes]
If yes, describe the new output and/or changes to the existing output:
met_tool_wrapper:30-58,68-69
medium_range:3-5,10
Do these changes introduce new SonarQube findings? [No]
If yes, please describe:
Please complete this pull request review by 2026/8/18.
Pull Request Checklist
See the METplus Workflow for details.
Select: Reviewer(s) and Development issue
Select: Milestone as the version that will include these changes
Select: Coordinated METplus-X.Y Support project for bugfix releases or METplus-Wrappers-X.Y.Z Development project for official releases