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

Generalize Transformation API #349

Merged
merged 10 commits into from
Jul 3, 2024
Merged

Generalize Transformation API #349

merged 10 commits into from
Jul 3, 2024

Conversation

pulsipher
Copy link
Collaborator

@pulsipher pulsipher commented Jul 3, 2024

This replaces the optimizer model abstraction which was limited to JuMP Models with a new abstraction based on what is called transformation backends. This introduces AbstractTransformationBackend to enable the use of arbitrary backends for solving InfiniteModels. For backends that use JuMP, this also adds JuMPBackend <: AbstractTransformationBackend which provides a similar API to the old optimizer model interface except it is more polished and doesn't rely on hacky "optimizer model keys".

TranscriptionOpt now only exports TranscriptionBackend which is based on JuMPBackend. All the former TranscriptionOpt specific query functions have been dropped from main API in favor of the general purpose ones (e.g., transformation_variable).

This also adds a few missing JuMP methods which include:

  • set_attribute
  • get_attribute
  • unsafe_backend
  • compute_conflict!
  • copy_conflict
  • set_string_names_on_creation
  • print_active_bridges
  • print_bridge_graph

It also cleans up the documentation and bit and uses the latest Documenter version.

Partly addresses #105 and #327. What remains for #105, is to decouple the transcription specific approaches from InfiniteOpt. This will require the following:

  • Refactoring the measure abstraction to be agnostic of the backend
  • Moving the derivative evaluation methods to TranscriptionOpt
  • Moving the measure expansion methods to TranscriptionOpt

Copy link

codecov bot commented Jul 3, 2024

Codecov Report

Attention: Patch coverage is 99.83766% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.77%. Comparing base (6e1102d) to head (85c3ab5).

Files Patch % Lines
src/TranscriptionOpt/transcribe.jl 99.21% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #349      +/-   ##
==========================================
+ Coverage   99.74%   99.77%   +0.03%     
==========================================
  Files          36       35       -1     
  Lines        6703     6712       +9     
==========================================
+ Hits         6686     6697      +11     
+ Misses         17       15       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pulsipher pulsipher added documentation Improvements or additions to documentation enhancement New feature or request breaking This will introduce breaking changes to the API transformations Something to do with model transformations labels Jul 3, 2024
@pulsipher pulsipher added this to the v0.6 milestone Jul 3, 2024
@pulsipher
Copy link
Collaborator Author

For now, I am going to turn off the checkdocs since it appears to have a bug: JuliaDocs/Documenter.jl#2545

@pulsipher pulsipher merged commit cc34cc5 into master Jul 3, 2024
10 checks passed
@pulsipher pulsipher deleted the general_backend branch July 3, 2024 18:45
This was referenced Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This will introduce breaking changes to the API documentation Improvements or additions to documentation enhancement New feature or request transformations Something to do with model transformations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant