PRIMA has got a Python interface

Thanks to the huge efforts of Nickolai Belakovski, PRIMA now has an official Python interface. It talks to Python via pybind11 and its C API instead of using F2PY.

I hope PRIMA will provide an example of binding modern Fortran libraries with Python.

Concerning Python, the next steps of PRIMA will be


BTW, Nickolai is truly outstanding as a person and a programmer / engineer. He worked for amazing companies including Bloomberg and Tesla. If you search for Nickolai Belakovski, you can find the following interesting article about him:

Rocket Science: From Russia and Bloomberg, With Love,

and the following one by him:

The little-known Soviet mission to rescue a dead space station

It is a privilege to have him contributing to PRIMA.

See Nickolai’s homepage for more (although it does not seem up to date).

15 Likes

This is excellent news. I wound up hiring some terrific consultants to do the same for a geoscience code of mine. Interestingly they also took advantage of my C API/bindings via pybind11.

3 Likes

Thank you for the kind words @zaikunzhang ! It’s been a fun and challenging project. We discovered a couple compiler bugs along the way, and we went deep into the Fortran standard to find solutions for our unique challenges. I look forward to continuing to improve the project!

3 Likes

The integration of PRIMA into scipy.optimize is nearing completion at ENH: optimize: integrate the PRIMA library for COBYLA by nbelakovski · Pull Request #20964 · scipy/scipy · GitHub. Any comments appreciated!

9 Likes

This is great! When it’s all done it would be great to read about the “lessons learned” from this process by the contributors. There’s probably a lot to learn here about modernizing legacy Fortran libraries for use in the Python ecosystem.

3 Likes