CeuAzul / ADR

Aircraft Design Resources - aircraft conceptual design framework
https://ceuazul.github.io/ADR
MIT License
14 stars 2 forks source link

Classes have state as object variables #136

Closed rafaellehmkuhl closed 4 years ago

rafaellehmkuhl commented 4 years ago

A lot of classes, such as Plane and Aerodynamic_surface have object state as object variables, with functions updating those states, instead of returning it.

    def update_alpha(self, alpha_airplane):
        self.attack_angle = alpha_airplane + self.incidence

This is bad because one does not know what has happened to the object before it was received, and the state could mean anything (e.g.: the takeoff analysis was run, saving the final state of plane's alpha as 15 degrees, and now the stability analysis is being run. Should I use the 15 degrees for something?). The state has meaning only inside an analysis, and so should only be a functional get method.

rafaellehmkuhl commented 4 years ago

Addressed in 2.0