Skip to content

Commit

Permalink
src: code refactoring - flightPath/badaFamily/badaVersion simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
henrich14 committed Oct 30, 2024
1 parent e06cb5b commit f3a0aca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
11 changes: 7 additions & 4 deletions examples/optimum_speed_altitude.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
from pyBADA.bada4 import Parser as Bada4Parser
from pyBADA.badaH import Parser as BadaHParser

# initialization of BADA3, BADA4 and BADAH
# uncomment for testing different BADA family if available
badaVersion = "DUMMY"
AC = BadaHAircraft(badaVersion=badaVersion, acName="DUMH")
# AC = Bada4Aircraft(badaVersion=badaVersion, acName='DUMMY-TWIN')

# initialization of BADA4
AC = Bada4Aircraft(badaVersion=badaVersion, acName="DUMMY-TWIN")
print("BADA4 Optimum Speed and Altitude:")

# BADA4
if AC.BADAFamily.BADA4:
Expand Down Expand Up @@ -77,6 +77,9 @@
optAlt_precomputed = AC.OPT.getOPTParam("OPTALT", M, mass)
print("optAlt_precomputed = ", optAlt_precomputed)

# initialization of BADAH
AC = BadaHAircraft(badaVersion=badaVersion, acName="DUMH")
print("\nBADAH Optimum Speed and Altitude:")

# BADAH
if AC.BADAFamily.BADAH:
Expand Down
2 changes: 0 additions & 2 deletions src/pyBADA/bada4.py
Original file line number Diff line number Diff line change
Expand Up @@ -3801,8 +3801,6 @@ def getOPTParam(self, optParam, var_1, var_2=None):

filename = os.path.join(
self.AC.filePath,
"BADA4",
self.AC.BADAVersion,
self.AC.acName,
optParam + ".OPT",
)
Expand Down
2 changes: 0 additions & 2 deletions src/pyBADA/badaH.py
Original file line number Diff line number Diff line change
Expand Up @@ -1215,8 +1215,6 @@ def getOPTParam(self, optParam, var_1, var_2, DeltaTemp):

filename = os.path.join(
self.AC.filePath,
self.AC.BADAFamilyName,
self.AC.BADAVersion,
self.AC.acName,
optParam + ".OPT",
)
Expand Down

0 comments on commit f3a0aca

Please sign in to comment.