Skip to content

Commit

Permalink
rename Airplane.export_xflr() to Airplane.export_XFLR5_xml()
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdsharpe committed Nov 21, 2023
1 parent 5883bfa commit c12c8aa
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Also, for at least one version before a breaking change, AeroSandbox development

#### 4.1.5

- PENDING DEPRECATION added: `asb.Airplane.export_XFLR()` has been renamed to `asb.Airplane.export_XFLR5_xml()`. This clarifies that the output is an XFLR5 XML file (which needs to be imported through the Plane menu in XFLR5), not an XFLR5 .xfl file - a point of user confusion. For now, both will work, but the old name will trigger a warning, and eventually will be removed.
- Added improvements to `asb.LiftingLine` to ensure mixed-backend compatibility.

#### 4.1.4
Expand Down
32 changes: 23 additions & 9 deletions aerosandbox/geometry/airplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,14 +946,28 @@ def export_AVL(self,
)
avl.write_avl(filepath=filename)

def export_XFLR(self,
filename,
mass_props: MassProperties = None,
include_fuselages: bool = False,
mainwing: Wing = None,
elevator: Wing = None,
fin: Wing = None,
):
def export_XFLR(self, *args, **kwargs):
import warnings

warnings.warn(
"`Airplane.export_XFLR()` has been renamed to `Airplane.export_XFLR5_xml()`, to clarify\n"
"that it exports to XFLR5's XML format, not to a XFL file.\n"
"\n"
"Please update your code to use `Airplane.export_XFLR5_xml()` instead.\n"
"\n"
"This function will be removed in a future version of AeroSandbox.",
PendingDeprecationWarning
)
return self.export_XFLR5_xml(*args, **kwargs)

def export_XFLR5_xml(self,
filename,
mass_props: MassProperties = None,
include_fuselages: bool = False,
mainwing: Wing = None,
elevator: Wing = None,
fin: Wing = None,
):
"""
Exports the airplane geometry to an XFLR5 `.xml` file.
Expand Down Expand Up @@ -1398,4 +1412,4 @@ def ft(feet, inches=0): # Converts feet (and inches) to meters
)

airplane.draw_three_view()
# airplane.export_XFLR("test.xml", mass_props=asb.MassProperties(mass=1, Ixx=1, Iyy=1, Izz=1))
# airplane.export_XFLR5_xml("test.xml", mass_props=asb.MassProperties(mass=1, Ixx=1, Iyy=1, Izz=1))

0 comments on commit c12c8aa

Please sign in to comment.