pyoptsparse icon indicating copy to clipboard operation
pyoptsparse copied to clipboard

Provide decorators for skipping code if an optimizer is not available

Open ewu63 opened this issue 3 years ago • 3 comments

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:

  • skipTest in pyOptSparse tests
  • test scripts in other repos (e.g. MACH-Aero, pygeo)

May be related to #187.

ewu63 avatar Apr 01 '21 16:04 ewu63

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

robfalck avatar Apr 01 '21 16:04 robfalck

Has this been addressed to the extent we wanted?

marcomangano avatar Mar 06 '22 18:03 marcomangano

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.

ewu63 avatar Mar 07 '22 00:03 ewu63