pyoptsparse icon indicating copy to clipboard operation
pyoptsparse copied to clipboard

Refactor optimizer wrappers

Open ewu63 opened this issue 4 years ago • 0 comments

Description of feature

There is a ton of shared code between different optimizer wrappers:

  • setting up the parameters
  • comm splitting and bcast after
  • creating the solution after

There are also tons of class attributes which are set by each optimizer without using the class structure properly. All these can be reorganized with significantly less code duplication.

Potential solution

  • Create a __call__ function in the parent class, which does the shared stuff:
    • This can call optimizer-specific functions which does the actual work (generating inputs, calling the optimizer, etc.)
  • In the init, properly set the class attributes.

ewu63 avatar Mar 20 '21 00:03 ewu63