JSOSuite.jl icon indicating copy to clipboard operation
JSOSuite.jl copied to clipboard

Find a way to not add every solver all at once

Open abelsiqueira opened this issue 2 years ago • 4 comments

There are too many dependencies, which slows down the user experience. Perhaps we should use v1.9 selective load? Perhaps require for < v1.9?

abelsiqueira avatar Jul 05 '23 20:07 abelsiqueira

My issue with this is that you have to know which packages to add beforehand then.

Or more concretly how can solve choose the appropriate solver automatically if the corresponding package is not loaded.

I agree with you that is a limitation and probably the reason why JSOSuite should be use for prototyping.

tmigot avatar Jul 05 '23 20:07 tmigot

I think we can select some sensible defaults that end up covering a large part of solvers. Percival includes JSOSolvers, which is already a big chunk of options. That should handle most non-specific NLP problems.

When you say used for prototyping, what do you mean?

I see a few ways that multi-package interfaces handle this:

  • @load Package solver - MLJ and I think Nonconvex do this
  • using Package which enables a structure to be used explicitly -JuMP and I think Optimization do this
  • using Package indirectly enabling an option somewhere - Don't know if any package does this

Using the Package Extensions (https://pkgdocs.julialang.org/v1.9/creating-packages/#Conditional-loading-of-code-in-packages-(Extensions)) and the backwards-compatible Requires.jl mentioned there, we can try something fast enough for first-time users, and maybe print a warning if the user uses a combination that is not ideal.

abelsiqueira avatar Jul 05 '23 21:07 abelsiqueira

Hey @abelsiqueira I added optional dependencies using Require so we remain compatible with Julia 1.6. It probably misses a bit of documentation but should work.

After, thé first release, we could just bump to 1.9 and use the new features. This way, we still have some options to maintain a 1.6 variant. What do you think?

tmigot avatar Jul 31 '23 15:07 tmigot

We can actually use the PackageExtensions compat (which uses Requires.jl) and keep supporting 1.6 until the next LTS drops. But I am fine implementing this with Requires now and moving to PkgExt later.

abelsiqueira avatar Jul 31 '23 17:07 abelsiqueira