Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Deal with both old and new locations of Var of docplex #1522

Merged
merged 3 commits into from
Feb 19, 2021

Conversation

t-imamichi
Copy link
Contributor

@t-imamichi t-imamichi commented Feb 5, 2021

Summary

Follow-up of #1520
Backport of qiskit-community/qiskit-optimization#23

Details and comments

I replaced mp.linear.Var with mp.dvar.Var to be compatible with the latest docplex 2.20.204.
mp.linear.Var was used until 2.15.194. So, I modified the code to work with both styles.

I add a version pin docplex==2.15.194 for macOS because docplex does not work without cplex on macOS.
See #24 for details.

@t-imamichi t-imamichi changed the title add minimum version of docplex Add minimum version of docplex Feb 5, 2021
@woodsp-ibm
Copy link
Member

woodsp-ibm commented Feb 5, 2021

I see 2.16.196 was released in early Nov last year - so its not that old. If the two classes are compatible in terms of internals could we do code that imported the Var from the new location and if that failed try the location where we imported it from before? This would give a broader compatibility if its reasonably doable.

-- See discussion, on same topic, in qiskit-community/qiskit-optimization#23

@t-imamichi t-imamichi changed the title Add minimum version of docplex Deal with both old and new locations of Var of docplex Feb 8, 2021
manoelmarques
manoelmarques previously approved these changes Feb 8, 2021
@t-imamichi
Copy link
Contributor Author

I would like to include it as part of Aqua 0.8.2 because some users may use docplex 2.15 or older. We need to discuss it as well as #1530

@t-imamichi t-imamichi marked this pull request as draft February 9, 2021 03:04
@woodsp-ibm
Copy link
Member

For now perhaps we should add the equivalent setup.py version pin of docplex as was done in the stable branch for the 0.8.2. release. This can be revisited if some better solution is found but at least then it will compatible to with what has just been released.

@t-imamichi
Copy link
Contributor Author

Yes, it might be good to pin docplex==2.15 until a bug fix of docplex is released so that docplex works without cplex.

@t-imamichi
Copy link
Contributor Author

t-imamichi commented Feb 16, 2021

This requires #1533 to avoid issues caused by astroid 2.5.

Update:
I see pylint 2.6.2 fixes the lint issues.

This was referenced Feb 16, 2021
@manoelmarques manoelmarques merged commit 178e795 into qiskit-community:master Feb 19, 2021
@t-imamichi t-imamichi deleted the fix-docplex2 branch February 20, 2021 02:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants