-
Notifications
You must be signed in to change notification settings - Fork 44
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
Replaced nlopt with scipy in dispersion fitter #457
Conversation
What about having the option to use nlopt if installed, and using that on our webservice? |
Webservice is largely independent of frontend code except for medium. So we can use NLOPT in webservice as long as we add NLOPT as requirement in webservice part independently. |
Well we need to keep the code that uses nlopt in here. I don't think we should have special code for the webservice. So what I'm suggesting is an extra parameter to the fit function, like |
I guess if we can get scipy working as well as nlopt, i see no reason to
keep nlopt personally.
…On Fri, Aug 5, 2022 at 6:03 PM momchil-flex ***@***.***> wrote:
Well we need to keep the code that uses nlopt in here. I don't think we
should have special code for the webservice. So what I'm suggesting is an
extra parameter to the fit function, like optimizer = ["scipy", "nlopt"]
or something (could be even more specific to which optimize function
exactly to use from these packages), and in the webservice we just use the
nlopt one. We can remove nlopt as a general dependence and raise an
appropriate error prompting the user to try to install it if someone tries
to run the fitter locally with nlopt optimizer and nlopt missing.
—
Reply to this email directly, view it on GitHub
<#457 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWDVXGH477HICC524FL3V43VXVCM5ANCNFSM55VIOKCQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Well, sure, but I'm dubious we'll be able to (there's a reason nlopt exists...) |
Well with almost no effort i was able to get pretty close to nlopt in my PR
removing nlopt so i feel like it is probably possible
…On Fri, Aug 5, 2022 at 6:14 PM momchil-flex ***@***.***> wrote:
Well, sure, but I'm dubious we'll be able to (there's a reason nlopt
exists...)
—
Reply to this email directly, view it on GitHub
<#457 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWDVXGG7FYUVIB3D33BDRHLVXVDX7ANCNFSM55VIOKCQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
One issue I read from scipy doc is that |
Looks good, but we shouldn't change anything in |
c85126f
to
76dd03d
Compare
Thanks @weiliangjin2021 , I guess the remaining question is how we should test how scipy works vs. nlopt. or whether this is even necessary with Momchil's recent changes in #452. I guess the main advantage of removing nlopt is to make it less likely users will have installation problems, like #441 , but if the performance of the fit is much worse, it's probably not worth it. If we test on the notebooks and |
I think the test should be purely on webservice side, so nlopt can be completely removed from the fronted part. |
So can we go ahead and wrap this up? |
For the frontend, it should be good to go. |
0bea3df
to
620fe26
Compare
In an attempt to remove
nlopt
from requirements, this PR replacesnlopt
with thescipy.optimize.minimize
from scipy.It needs a 2nd pair of eyes on it to make sure I set up the constriaints and various parameters correctly, could you take a look Weiliang?
When running the dispersion fitter tests in
test/plugins
, I get similar (but slightly worse) final results:with nlopt
with scipy: