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

Add MOI_PythonCall extension + Add #10

Merged
merged 1 commit into from
Oct 1, 2023
Merged

Conversation

pedromxavier
Copy link
Member

This PR aims to provide a MOI-PythonCall extension, as discussed in jump-dev/MathOptInterface.jl#2301. Merging it closes #9.

It contains the extension itself and tests.

@codecov
Copy link

codecov bot commented Oct 1, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (f517c0f) 82.17% compared to head (58031dd) 82.20%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #10      +/-   ##
==========================================
+ Coverage   82.17%   82.20%   +0.03%     
==========================================
  Files          19       20       +1     
  Lines         488      489       +1     
==========================================
+ Hits          401      402       +1     
  Misses         87       87              
Files Coverage Δ
ext/MOI_PythonCall.jl 100.00% <100.00%> (ø)

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

@pedromxavier pedromxavier merged commit 973a41c into master Oct 1, 2023
6 checks passed
import PythonCall

if !hasmethod(MOI.Utilities.map_indices, Tuple{PythonCall.Py})
MOI.Utilities.map_indices(::Function, obj::PythonCall.Py) = obj
Copy link

Choose a reason for hiding this comment

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

What was the motivation for adding as an extension?

MOI will always be loaded by QUBODrivers.jl (it is a direct dependency).

This method could have been added directly to src.

Copy link
Member Author

@pedromxavier pedromxavier Oct 3, 2023

Choose a reason for hiding this comment

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

MOI is always loaded but PythonCall isn't.
PythonCall is also double-trouble: besides being heavy, precompiling it involves installing and managing python deps. We don't want to add it as a QUBODrivers dep

@pedromxavier pedromxavier deleted the px/moi-pythoncall-ext branch September 19, 2024 15:20
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.

Wrap PythonCall.Py objects when using MOI attributes
2 participants