mdolab / mdolab/pyoptsparse

Refactor optimizer wrappers

Open
#220 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

maintenance
Dominant language
Python
Stars
270
Forks
123
Avg merge
1d 18h
Merged PRs (30d)
3

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by locating the parent optimizer-wrapper class and its optimizer-specific subclasses, then compare their parameter setup, communication, and solution-creation paths. Done means shared behavior is handled by the parent call, optimizer-specific work remains in subclass hooks, and class attributes are initialized through the class structure with less duplication.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.