Remove duplicate check_chemistry() calls from stage validators#1627
Open
rayair250-droid wants to merge 1 commit into
Open
Remove duplicate check_chemistry() calls from stage validators#1627rayair250-droid wants to merge 1 commit into
rayair250-droid wants to merge 1 commit into
Conversation
check_chemistry() ran twice per validation: once in validate_common() (called by every stage) and again in validate_simulation/pre_process/post_process. A violated chemistry constraint was therefore reported twice. Remove the three redundant per-stage calls; validate_common() covers all stages. Part (b) of MFlowCode#1509.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1627 +/- ##
=======================================
Coverage 60.43% 60.43%
=======================================
Files 83 83
Lines 19868 19868
Branches 2956 2956
=======================================
Hits 12007 12007
Misses 5860 5860
Partials 2001 2001 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Addresses part (b) of #1509.
check_chemistry()ran twice per validation: once invalidate_common()(which every stage calls) and again at the end ofvalidate_simulation,validate_pre_process, andvalidate_post_process. Becauseprohibit()appends toself.errorswhenever its condition holds, a single violated chemistry constraint was reported twice. This removes the three redundant per-stage calls;validate_common()already covers all stages, so coverage is unchanged and behavior is identical except that duplicate error-list entries no longer appear.Smallest-correct-change: 3 deletions, no additions.
On part (a) of the issue (left out on purpose)
I checked the fallback-constant drift against current
masterand it has partly moved since the issue was filed, so I did not apply the values from the issue:num_ib_patches_maxfallback site the issue cited (case_validator.py:585) no longer exists.src/common/m_constants.fpp,num_ib_patches_maxis now2050000(the issue said50000).num_patches_max(fallback1000vs real10);num_bc_patches_maxalready matches.Since (a) is a never-normally-hit fallback path (hygiene only, as the issue notes) and its premise has drifted, I kept this PR to the clear (b) fix. Happy to do the
num_patches_maxfallback in a small follow-up if you want it.