Skip to content

Add extension to GenOpt#237

Open
blegat wants to merge 17 commits intoexanauts:mainfrom
blegat:genopt
Open

Add extension to GenOpt#237
blegat wants to merge 17 commits intoexanauts:mainfrom
blegat:genopt

Conversation

@blegat
Copy link
Copy Markdown
Contributor

@blegat blegat commented Mar 2, 2026

To add GenOpt support to ExaModels, the current approach in https://github.com/blegat/GenOpt.jl/blob/main/src/examodels.jl was to copy-paste the MOI wrapper of ExaModels and then hack it.
In this PR, I'd like to see if it's possible to extend the MOI wrapper here because since it's heavily dependent on the internals of the MOI wrappers, it will be easier to maintain it in the same repo as the MOI wrapper

blegat referenced this pull request in blegat/GenOpt.jl Apr 16, 2026
Comment thread Project.toml Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 0% with 102 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (6f15038) to head (57e02ec).
⚠️ Report is 18 commits behind head on main.

Files with missing lines Patch % Lines
ext/ExaModelsGenOpt.jl 0.00% 60 Missing ⚠️
ext/ExaModelsMOI.jl 0.00% 41 Missing ⚠️
src/wrapper.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #237       +/-   ##
==========================================
- Coverage   80.80%   0.00%   -80.81%     
==========================================
  Files          20      28        +8     
  Lines        2021    3005      +984     
==========================================
- Hits         1633       0     -1633     
- Misses        388    3005     +2617     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/nlp.jl
@blegat blegat marked this pull request as ready for review April 17, 2026 13:57
@github-actions
Copy link
Copy Markdown
Contributor

Your PR requires formatting changes to meet the project's style guidelines.

Please run:

julia --project=@runic -e 'using Pkg; Pkg.add("Runic")'
julia --project=@runic -e "using Runic; exit(Runic.main(ARGS))" -- --fix <files>

(or git runic main if you have the git wrapper installed)

Note: the full diff is omitted because it can exceed GitHub Actions input limits.

@sshin23
Copy link
Copy Markdown
Collaborator

sshin23 commented Apr 20, 2026

Sry-the Metal issue probably was me closing the ci laptop lid

Copy link
Copy Markdown
Collaborator

@sshin23 sshin23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m fine with whatever changes to ExaModelsMOI.jl are needed to make GenOpt work, though I’m not sure whether ExaModelsGenOpt.jl should be stored in the ExaModels.jl repository. Wouldn’t it make more sense to keep it in GenOpt.jl instead?

Comment thread src/wrapper.jl Outdated
Map a Symbol to the corresponding Julia function. Used by both ExaModelsMOI
and ExaModelsGenOpt for expression tree conversion.
"""
function op(s::Symbol)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this moved from ExaModelsMOI.jl?

@sshin23
Copy link
Copy Markdown
Collaborator

sshin23 commented Apr 21, 2026

Looks like there are no type piracy concerns

@blegat
Copy link
Copy Markdown
Contributor Author

blegat commented Apr 22, 2026

I’m fine with whatever changes to ExaModelsMOI.jl are needed to make GenOpt work, though I’m not sure whether ExaModelsGenOpt.jl should be stored in the ExaModels.jl repository. Wouldn’t it make more sense to keep it in GenOpt.jl instead?

Good question. My feeling is that it might be easier to maintain here because ExaModelsMOI.jl and ExaModelsGenOpt.jl are intertwined in a non-trivial way. If we added an ExaModels extension to GenOpt instead, it would mean that what we put in src/wrapper.jl should be a well-defined public API and we should come up with precise behavior that ExaModelsMOI.jl should keep in order for the ExaModels extension to GenOpt to keep working, and even add tests here to make sure ExaModelsMOI.jl don't break that. If it does and it is needed, then it will need to trigger a breaking release for ExaModels. On the other hand, with the current design having ExaModelsMOI.jl and ExaModelsGenOpt.jl both in ExaModels, any modifications of ExaModelsMOI.jl that don't break the tests in test/GenOptTest is fine, we don't need to be extra careful when modifying ExaModelsMOI.jl. Of course, then we would need to modify ExaModelsGenOpt.jl when GenOpt makes a breaking release but as ExaModelsGenOpt.jl only uses what's already public API from GenOpt, we won't need to make more breaking releases because the extension is in ExaModels. So it seems overall easier to maintain here. Of course, that puts the maintainance on your side but I can take care of updating it whenever GenOpt makes a breaking release :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants