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

Are you interested in a Minpack wrapper? #63

Open
Nicholaswogan opened this issue May 10, 2021 · 8 comments
Open

Are you interested in a Minpack wrapper? #63

Nicholaswogan opened this issue May 10, 2021 · 8 comments

Comments

@Nicholaswogan
Copy link

Nicholaswogan commented May 10, 2021

@stuartarchibald I made a wrapper for Minpack, which can be called from within numba jit compiled functions: https://github.com/Nicholaswogan/NumbaMinpack . scipy.optimize.root uses minpack. The wrapper is a bit hacky, but it has worked well for me.

Wondering if you would be interested in implementing NumbaMinpack into numba-scipy. If so, I can put together a pull request, which would add a folder numba-scipy/optimize .

@Nicholaswogan Nicholaswogan changed the title Are you interested in my Minpack wrapper? Are you interested in a Minpack wrapper? May 11, 2021
@esc
Copy link
Member

esc commented May 17, 2021

@Nicholaswogan thank you for bringing this to our attention. One of the advantages of the numba-scipy project, is that it is easy to install across OSX/Linux/Windows b/c it has minimal dependencies and ships zero binary code. So the gfortran dependency and the limit to OSX and Linux may be a bit too much for numba-scipy?

However, it would be very, very nice to be able to use scipy.optimize from within @njit decorated functions. So maybe a tighter integration of NumbaMinpack and numba-scipy may be an option? For example, mentioning the project in the numba-scipy README and maybe making it easier to install/use them together? Personally, I would even be in favour of potentially adding the project to the numba organization on Github. This would perhaps give it more exposure and also help to attract additional interested parties and also give it somewhat of an "official" stamp. What do you think about this? What do @stuartarchibald @seibert @sklam think about this suggestion?

Lastly -- and this is probably a bit of a longshot -- how about looking into using LFortran as a compiler? It also uses LLVM (maybe even llvmlite, if I am not mistaken) and there do appear to be some interesting routes in that direction.

@Nicholaswogan
Copy link
Author

@esc That makes sense. The gfortran dependency wouldn't be cross platform, so it makes sense it wouldn't be the best for numba-scipy. I looked at the LFortran compiler. It doesn't look quite ready for compiling Minpack. But maybe a year or so down the road LFortran could be perfect for this kind of thing.

For example, mentioning the project in the numba-scipy README and maybe making it easier to install/use them together? Personally, I would even be in favour of potentially adding the project to the numba organization on Github. This would perhaps give it more exposure and also help to attract additional interested parties and also give it somewhat of an "official" stamp. What do you think about this?

I'm very open to any of these ideas! More exposure would certainly lead to good ideas from the numba community for improving the wrapper. Let me know what I can do to help.

@esc
Copy link
Member

esc commented May 18, 2021

@esc That makes sense. The gfortran dependency wouldn't be cross platform, so it makes sense it wouldn't be the best for numba-scipy. I looked at the LFortran compiler. It doesn't look quite ready for compiling Minpack. But maybe a year or so down the road LFortran could be perfect for this kind of thing.

For example, mentioning the project in the numba-scipy README and maybe making it easier to install/use them together? Personally, I would even be in favour of potentially adding the project to the numba organization on Github. This would perhaps give it more exposure and also help to attract additional interested parties and also give it somewhat of an "official" stamp. What do you think about this?

I'm very open to any of these ideas! More exposure would certainly lead to good ideas from the numba community for improving the wrapper. Let me know what I can do to help.

I think the first step, which is also easy to get in, would be to mention NumbaMinpack in the numba-scipy documentation somewhere, either README or Sphinx or both. I'd be very open to accepting such a PR outright. This is actionable.

Pulling the repo in the Numba organization is a much bigger step, that the current maintainers will need to agree on and getting that consensus may take some time. This is in my court and "in progress", I would say.

@stuartarchibald
Copy link
Contributor

@Nicholaswogan thanks for raising this (and writing the library!), really great to see minpack usable from Numba.

Thanks for providing guidance here @esc, suggest that the various items mentioned above are discussed at the next public meeting (they are every Tuesday!) to gather some community feedback in relation to this sort of use case.

@Nicholaswogan
Copy link
Author

@stuartarchibald Sounds great! I'll be at the public meeting this coming Tuesday.

@Nicholaswogan
Copy link
Author

@stuartarchibald let me know when the build template we talked about in this meeting is put together, and I'll try it on Minpack.

@stuartarchibald
Copy link
Contributor

@stuartarchibald let me know when the build template we talked about in this meeting is put together, and I'll try it on Minpack.

Great, thanks, will let you know!

@Nicholaswogan
Copy link
Author

@stuartarchibald I also put together a similar wrapper to LSODA, for solving ordinary differential equations: https://github.com/Nicholaswogan/NumbaLSODA . I used CMake with setup.py to install so its more platform independent, but I don't think it would work on Windows right out of the box.

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

3 participants