Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNMY: [FileFormats.MOF] change parse_as_nlpblock to false by default #2295

Closed
wants to merge 1 commit into from

Conversation

odow
Copy link
Member

@odow odow commented Sep 27, 2023

I've opened this PR, not because I want to merge it, but because I think it needs some discussion.

Currently, if you have a .mof.json file that contains nonlinear functions, they are parsed into an NLPBlock.

#2293 added support for parsing them as regular ScalarNonlinearFunctions, but made it opt-in behind a parse_as_nlpblock keyword.

To read in JuMP, you'd need to write:

using JuMP
m = JuMP.read_from_file("test.mof.json"; parse_as_nlpblock = false)

This PR proposes swapping the default, which is a breaking change if people expect the NLPBlock to exist, or if they're passing to a solver that doesn't support the new syntax yet.

We could potentially reduce the breakage by changing default_copy_to, so that, if a src model has ScalarNonlinearFunction but the dest model doesn't support them, we could convert to a NLPBlock. This would then only impact people using MOF.Model directly, not not some reading from a file in JuMP.

Or we could say that the nonlinear support in .mof.json was always experimental. It seems likely that very few people are actually using .mof.json files to store models, particularly nonlinear ones.

Or we could keep the default as-is and add a warning telling people to use the keyword argument, and that it might change the default in a future release.

Thoughts?

@odow odow added Submodule: FileFormats About the FileFormats submodule Project: next-gen nonlinear support Issues relating to nonlinear support labels Sep 27, 2023
@odow
Copy link
Member Author

odow commented Sep 28, 2023

Change to use_nlp_block to match NL files, and document this, and document it at the JuMP level.

@odow
Copy link
Member Author

odow commented Sep 28, 2023

Discussed on call. Closing in favor of #2299

@odow odow closed this Sep 28, 2023
@odow odow deleted the od/mof-nlp-block branch September 28, 2023 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Project: next-gen nonlinear support Issues relating to nonlinear support Submodule: FileFormats About the FileFormats submodule
Development

Successfully merging this pull request may close these issues.

1 participant