Fix load_operator for LinearNonlinearParamOperator#40
Open
Ady0333 wants to merge 1 commit intogridap:mainfrom
Open
Fix load_operator for LinearNonlinearParamOperator#40Ady0333 wants to merge 1 commit intogridap:mainfrom
Ady0333 wants to merge 1 commit intogridap:mainfrom
Conversation
_fixed_operator_parts → _load_fixed_operator_parts (typo caused UndefVarError on every call to load_operator for nonlinear problems). Signed-off-by: Ady0333 <adityashinde1525@gmail.com>
Contributor
Author
|
Hello @nichomueller , |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #40 +/- ##
=======================================
Coverage 45.99% 45.99%
=======================================
Files 112 112
Lines 15063 15063
=======================================
Hits 6928 6928
Misses 8135 8135 ☔ View full report in Codecov by Sentry. 🚀 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.
Fixes #39
Problem
The
load_operatorfunction forLinearNonlinearParamOperatorinsrc/RB/RBSteady/PostProcess.jl(line 184) calls a non-existent function_fixed_operator_partsinstead of the correct_load_fixed_operator_parts.Current broken code:
This is a copy-paste typo where the
_load_prefix was dropped. The correct function_load_fixed_operator_partsis defined at line 146 in the same file.Evidence this is wrong:
src/RB/RBTransient/PostProcess.jl:55) correctly callsRBSteady._load_fixed_operator_parts_load_fixed_operator_partsLinearNonlinearParamOperatorspecialization has the typoImpact
Who is affected: Anyone working with steady nonlinear ROM problems (Navier-Stokes, nonlinear elasticity, etc.) who saves a reduced operator and tries to reload it.
What breaks:
load_operatoron aLinearNonlinearParamOperatorcrashes withUndefVarError: _fixed_operator_parts not definedSilent failure scenario: Users think their saved data doesn't exist or is corrupted, when the load function itself is just broken. The save path works fine only loading fails.
How to Reproduce
In the examples framework, this manifests as silent recomputation instead of loading precomputed data.
Fix
Changed:
src/RB/RBSteady/PostProcess.jl, line 184Added the missing
_load_prefix to the function name:One line, one prefix. The save path already worked correctly only the load path was broken.
Testing
Added
test/RBSteady/save_operator.jlwith regression tests that verify:_load_fixed_operator_partsexists inRBSteadymodule_fixed_operator_parts(the typo) does NOT existload_operatorhas a method forLinearNonlinearParamOperatorThe fourth check is particularly important it prevents someone from "fixing" the crash by defining the wrong function instead of fixing the actual typo.
Test strategy: Uses compile-time verification instead of full integration testing (which would require heavy FEM setup). This keeps tests fast while ensuring the bug can't be reintroduced.
After This Fix