PRIMA is a package for solving general nonlinear optimization problems without using derivatives. It provides the reference implementation for Powell's renowned derivative-free optimization methods, i.e., COBYLA, UOBYQA, NEWUOA, BOBYQA, and LINCOA. The "P" in the name stands for Powell, and "RIMA" is an acronym for "Reference Implementation with Modernization and Amelioration".
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
PRIMA is part of a research project funded by the Hong Kong Research Grants Council and the Department of Applied Mathematics (AMA) at the Hong Kong Polytechnic University (PolyU). The current version is ready to be used in Fortran, in C, in Python, in MATLAB, and in Julia.
Michael James David Powell FRS [1] was "a British numerical analyst who was among the pioneers of computational mathematics" [2]. He was the inventor/early contributor of quasi-Newton method [3], trust region method [4], augmented Lagrangian method [5], and SQP method [6]. Each of them is a pillar of modern numerical optimization. He also made significant contributions to approximation theory and methods [7].
Among numerous honors, Powell was one of the two recipients of the first Dantzig Prize [8] from the Mathematical Programming Society (MOS) and Society for Industrial and Applied Mathematics (SIAM). This is considered the highest award in optimization.
I find that using tools like pybind11 to create python bindings rather than trying to write Python C API directly greatly decreases fragility since the pybind11 team have already spent a lot more time than me understanding the python API and dealing with all the weird corner cases and optimisations.
Matter of taste to some extent I suppose. I've worked with the Python C API, it's not pretty but not too bad. I could see adding a tool to get something up and running quickly would be useful in some cases, but it strikes me that this is a really high quality core product, adding a new language has got to have risks, I'd reckon it would be worth doing the binding manually (and it only has to be done the once).
If you use method "cobyla" from scipy.optimize.minimize, then answer is now. PRIMA already performs far better (in terms of the number of function evaluations). See the comparison at https://github.com/libprima/prima#improvements .
The bugs are indeed only a secondary reason: they can only be triggered under special situations. They may not affect your usage at all (when it does affect you, the consequence is catastrophophic).
They claim there are bugs in the COBYLA solver implementations included in scipy that this implementation has fixed. So I guess if you run into any of those bugs then PRIMA is better.
They're apparently also in discussion with the scipy team to include their implementation in scipy, so hopefully the question will be moot in the not too distant future
https://fortran-lang.discourse.group/t/prima-has-got-a-pytho...