OpenMDAO / Aviary

NASA's aircraft analysis, design, and optimization tool
https://openmdao.github.io/Aviary/
Other
106 stars 51 forks source link

Refactor code to minimize duplication #368

Open jkirk5 opened 5 days ago

jkirk5 commented 5 days ago

Desired capability or behavior.

from @dlcaldwelljr-ama-inc: Several files copy/paste the same code "too much" - from one section to another in the same file, or from one file to the next.

Refactor the code base to wrap common code in utilities like stand-alone and base class functions.

Is your feature request related to a problem? Please describe.

Too much copy/paste translates to more work tracking/fixing bugs and updating/replacing code. We may need to refactor some of the code base for better code reuse. This will take a deep dive to correctly identify what can be reused, as some reusable code is copy/paste, while other reusable code has been retyped using different formatting, variable names, and/or comments.

IMHO, this is a bug, because it works against code maintenance in the long run.

Example Example using propulsion in ODEs: this code may appear in several ODE components, or code very much like it. - gasp_based/ode/groundroll_ode.py

Associated Bug Report

No response