OpenMDAO / Aviary

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

Refactor subsystem builder methods that can be properties #347

Open johnjasa opened 1 week ago

johnjasa commented 1 week ago

Multiple different methods in SubsystemBuilderBase could be properties to simplify their use. This is backwards incompatible though generally worthwhile; could deprecate the existing methods.

    @property
    def get_mass_names(self):

so it can be accessed as BatteryBuilder.get_mass_names instead of BatteryBuilder.get_mass_names(), since no arguments are used

_Originally posted by @crecine in https://github.com/OpenMDAO/Aviary/pull/317#discussion_r1651562417_

crecine commented 1 week ago

I don't think it is backwards incompatible, I'm pretty sure it still works with the parenthesis, they just aren't necessary anymore.