bugfix 730 main_v3.1 time_info corrupted #741
Merged
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.
The bug occurs when a time_info dictionary is passed back into time_util.ti_calculate. The function checks if init and valid are both set in the input dictionary. If so, it uses the loop_by value to determine which of them to delete from the dictionary so it will be recomputed. The call to del on the input dictionary deleted the 'valid' item from the input dictionary which is still used elsewhere in the code.
To fix in v3.1, copy input to ti_calculate into a new dictionary so that it can't be corrupted
Pull Request Testing
/d1/projects/METplus/METplus_Development/bugfix_time_info/METplus.main_v3.1/ush/master_metplus.py -c /d1/projects/METplus/METplus_Development/bugfix_time_info/metplus_final.conf
/d1/projects/METplus/METplus_Development/bugfix_time_info/METplus.main_v3.1_fix/ush/master_metplus.py -c /d1/projects/METplus/METplus_Development/bugfix_time_info/metplus_final.conf
Will this PR result in changes to the test suite? [No]
If yes, describe the new output and/or changes to the existing output:
After merging, should the reviewer DELETE the feature branch from GitHub? [Yes]
Pull Request Checklist
See the METplus Workflow for details.
Select: Reviewer(s), Project(s), and Milestone