[FileFormats.MOF] make use_nlp_block=false the default if SNF in model#2688
Merged
[FileFormats.MOF] make use_nlp_block=false the default if SNF in model#2688
Conversation
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.
Closes #2687
The underlying issue is that we supported nonlinear file formats before the introduction of ScalarNonlinearFunction. Thus,
.mof.jsonand.nlthat contain nonlinear get parsed into aMOI.NLPBlock. This is the "old" nonlinear interface, and it means that Ipopt etc run into problems if the user wants to read in a file and then do some "new" stuff with it.The current work-around is to use
read_from_file(model; use_nlp_block = false).But we could add a tag to the file on write if we detect
MOI.ScalarNonlinearFunction. This would all "new" stuff to round-trip as new, and "old" stuff to round-trip as old.The alternative would be to change the default to
use_nlp_block = false, but this is technically breaking. Although this is also breaking, but arguably a bug-fix, because currently "new" models get written and then read back in as "old".Once we agree on what to do, we should make a similar fix to the
.nlfile module. It probably means adding a header comment about whether we hadScalarNonlinearFunctions.