|
1 | 1 | from aerosandbox.common import AeroSandboxObject |
2 | 2 | from aerosandbox.geometry.common import * |
3 | | -from typing import Any, Callable, Sequence |
| 3 | +from typing import Any, Callable, Literal, Sequence |
4 | 4 | from aerosandbox.geometry.airfoil import Airfoil |
5 | 5 | from numpy import pi |
6 | 6 | import aerosandbox.numpy as np |
@@ -138,7 +138,7 @@ def translate(self, xyz: np.ndarray | Sequence[float]) -> "Wing": |
138 | 138 |
|
139 | 139 | def span( |
140 | 140 | self, |
141 | | - type: str = "yz", |
| 141 | + type: Literal["xyz", "xy", "top", "yz", "front", "xz", "side", "x", "y", "z"] = "yz", |
142 | 142 | include_centerline_distance=False, |
143 | 143 | _sectional: bool = False, |
144 | 144 | ) -> float | list[float]: |
@@ -287,7 +287,7 @@ def span( |
287 | 287 |
|
288 | 288 | def area( |
289 | 289 | self, |
290 | | - type: str = "planform", |
| 290 | + type: Literal["planform", "wetted", "xy", "projected", "top", "xz", "side", "yz"] = "planform", |
291 | 291 | include_centerline_distance=False, |
292 | 292 | _sectional: bool = False, |
293 | 293 | ) -> float | list[float]: |
@@ -413,7 +413,7 @@ def area( |
413 | 413 |
|
414 | 414 | def aspect_ratio( |
415 | 415 | self, |
416 | | - type: str = "geometric", |
| 416 | + type: Literal["geometric", "effective"] = "geometric", |
417 | 417 | ) -> float: |
418 | 418 | """ |
419 | 419 | Computes the aspect ratio of the wing, with options for various ways of measuring this. |
@@ -765,7 +765,7 @@ def set_control_surface_deflections( |
765 | 765 | def control_surface_area( |
766 | 766 | self, |
767 | 767 | by_name: str | None = None, |
768 | | - type: str | None = "planform", |
| 768 | + type: Literal["planform", "wetted", "xy", "projected", "top", "xz", "side"] | None = "planform", |
769 | 769 | ) -> float: |
770 | 770 | """ |
771 | 771 | Computes the total area of all control surfaces on this wing, optionally filtered by their name. |
@@ -830,7 +830,7 @@ def control_surface_area( |
830 | 830 |
|
831 | 831 | def mesh_body( |
832 | 832 | self, |
833 | | - method="quad", |
| 833 | + method: Literal["tri", "quad"] = "quad", |
834 | 834 | chordwise_resolution: int = 36, |
835 | 835 | chordwise_spacing_function_per_side: Callable[[float, float, int], np.ndarray] = np.cosspace, |
836 | 836 | mesh_surface: bool = True, |
@@ -994,7 +994,7 @@ def add_face(*indices): |
994 | 994 |
|
995 | 995 | def mesh_thin_surface( |
996 | 996 | self, |
997 | | - method="tri", |
| 997 | + method: Literal["tri", "quad"] = "tri", |
998 | 998 | chordwise_resolution: int = 36, |
999 | 999 | chordwise_spacing_function: Callable[[float, float, int], np.ndarray] = np.cosspace, |
1000 | 1000 | add_camber: bool = True, |
|
0 commit comments