mdolab / pyoptsparse

pyOptSparse is an object-oriented framework for formulating and solving nonlinear constrained optimization problems in an efficient, reusable, and portable manner.
https://mdolab-pyoptsparse.readthedocs-hosted.com/en/latest/
GNU Lesser General Public License v3.0
221 stars 106 forks source link

Provide decorators for skipping code if an optimizer is not available #224

Open ewu63 opened 3 years ago

ewu63 commented 3 years ago

Description

Dymos recently added a decorator in openmdao/dymos#570, which may be something we want to implement in pyOptSparse natively also. This could be useful for:

May be related to #187.

robfalck commented 3 years ago

Feel free to take as much of our implementation as you want.

marcomangano commented 2 years ago

Has this been addressed to the extent we wanted?

ewu63 commented 2 years ago

Not quite, but it's close. Right now we can check the availability of top-level packages with the decorator in baseclasses, but not submodules, e.g. pySNOPT. The intent here is to check specifically for the optimizers, which in most cases involves checking the compiled library, e.g. snopt.so.