-
Notifications
You must be signed in to change notification settings - Fork 87
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 extension support for PythonCall
#2301
Comments
Do you have an example of this? It's a trivial method so I don't think piracy is the end of the world. But you could probably refactor the solver one your end. |
The lines above are passed into the Packages as QiskitOpt.jl and DWave.jl rely on Python APIs for connecting to solvers in the cloud. This method has to be implemented for both QiskitOpt.jl and DWave.jl, which leads the compiler to complain about it. A solution would be for QUBODrivers to have an extension to implement this method when PythonCall is loaded (since it already depends on MOI). |
Instead of
do something like
This is something that can/should be worked around in QiskitOpt.jl, not in MOI. I don't really want to create an extension just to add this single method for PythonCall. |
I agree with you that a wrapper is the best way to go. This will have to be fixed at QUBODrivers level, since some other projects use it to reach out to Python too. I think your suggestion is sufficient to close the issue. |
I think you're also okay to add |
As far as I understood, |
I don't really understand the macro, but yes, you'd need the user to pass something like I wouldn't have a generic wrapper, I'd perhaps make one for each attribute. |
But in the near term, just be a 🏴☠️ |
Ahoy! 🏴☠️ |
Closing this as won't-fix. |
When building MOI wrappers for Python solvers using
PythonCall
, it is necessary to implementMOIU.map_indices(::Function, x::PythonCall.Py) = x
for Python objects to be accepted in the MOI attribute system.
A possible solution, to avoid type piracy, is for MOI to have a
PythonCall
extension.The text was updated successfully, but these errors were encountered: