-
-
Notifications
You must be signed in to change notification settings - Fork 208
Closed
Labels
OutputsDedicated to visualizations enhancements like prints and plotsDedicated to visualizations enhancements like prints and plotsRefactor
Milestone
Description
Is your feature request related to a problem? Please describe.
Currently, there is a bunch of logic and conditional loops inside the Rocket class allInfo(self) (line 1169) method. This makes it harder for the frontend team to consume a subset view data of allInfo without code duplication, hence violating DRY.
Describe the solution you'd like
I think a good approach would be to encapsulate every loop and conditional existing at the allInfo method in a private method or lambda making the logic behind the view (print) transparent for the allInfo method.
Additional context
For instance, in the parachute data:
# Print parachute data
for chute in self.parachutes:
print("\n" + chute.name.title() + " Parachute")
print("CdS Coefficient: " + str(chute.CdS) + " m2")
if chute.trigger.__name__ == "<lambda>":
line = getsourcelines(chute.trigger)[0][0]
print(
"Ejection signal trigger: "
+ line.split("lambda ")[1].split(",")[0].split("\n")[0]
)
else:
print("Ejection signal trigger: " + chute.trigger.__name__)
print("Ejection system refresh rate: " + str(chute.samplingRate) + " Hz.")
print(
"Time between ejection signal is triggered and the "
"parachute is fully opened: " + str(chute.lag) + " s"
)
I think it would be better if we had something like:
# Print parachute data
print("\n" + parachutes_name_and_coefficient())
print("\n" + ejection_sinal_trigger())
giovaniceottoGui-FernandesBR
Metadata
Metadata
Assignees
Labels
OutputsDedicated to visualizations enhancements like prints and plotsDedicated to visualizations enhancements like prints and plotsRefactor
Type
Projects
Status
Closed