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

Conflict with NLopt #98

Open
pizhn opened this issue Jul 11, 2021 · 5 comments
Open

Conflict with NLopt #98

pizhn opened this issue Jul 11, 2021 · 5 comments

Comments

@pizhn
Copy link
Collaborator

pizhn commented Jul 11, 2021

optimize in Nonconvex will conflict with optimize in NLopt. Better resolve it when import both

@mohamed82008
Copy link
Member

This is why I use import NLopt in the docs, not using. I don't think there is a better way to resolve this.

@pizhn
Copy link
Collaborator Author

pizhn commented Jul 11, 2021

@mohamed82008
Copy link
Member

No because we can't extend NLopt's optimize without depending on it which I don't (it's an optional dependency) and NLopt can't do the same without depending on Nonconvex which also doesn't make sense. Also extending functions you don't own by dispatching on types you don't own is bad practice in Julia, called type piracy. It's bad because it modifies the behavior of code that may not have anything to do with Nonconvex. You can get away with it every once in a while but only when it's absolutely necessary and there is little risk.

@mohamed82008
Copy link
Member

Would be nice to have a warning in the docs saying that you must use import not using.

@mohamed82008
Copy link
Member

If you use using, you will need to use Nonconvex.optimize later.

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

No branches or pull requests

2 participants