Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ understanding of biological flight.
* Wings can be defined as a collection of two or more wing cross sections of any
dimensions and positions.
* Wing cross sections can be specified to match the mean camber line of an airfoil.
* The package comes with a massive database of airfoil to chose from.
* The package comes with a massive database of airfoils to choose from.
* Wings are automatically discretized into panels with customizable sizes and
spacings.
3. Customizable Aircraft Motion
Expand Down
2 changes: 1 addition & 1 deletion make_installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "PteraSoftware"
#define MyAppVersion "3.2.0"
#define MyAppVersion "4.0.0"
#define MyAppPublisher "CamUrban"
#define MyAppURL "https://github.com/camUrban/PteraSoftware"
#define MyAppExeName "PteraSoftware.exe"
Expand Down
19 changes: 14 additions & 5 deletions pterasoftware/_parameter_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,11 @@ def threeD_number_vectorLike_return_float_unit_vector(


# TEST: Consider adding unit tests for this function.
def threeD_spacing_vectorLike_return_tuple(
value: Any, name: str
) -> tuple[str | Callable, str | Callable, str | Callable]:
def threeD_spacing_vectorLike_return_tuple(value: Any, name: str) -> tuple[
str | Callable[[np.ndarray], np.ndarray],
str | Callable[[np.ndarray], np.ndarray],
str | Callable[[np.ndarray], np.ndarray],
]:
"""Validates a value is a 3D vector-like object (array-like object with shape (3,))
of spacing specifications, and then returns it as a tuple of 3 spacing
specifications.
Expand Down Expand Up @@ -436,7 +438,14 @@ def threeD_spacing_vectorLike_return_tuple(
)

validated_value = tuple(validated_list)
return cast(tuple[str | Callable, str | Callable, str | Callable], validated_value)
return cast(
tuple[
str | Callable[[np.ndarray], np.ndarray],
str | Callable[[np.ndarray], np.ndarray],
str | Callable[[np.ndarray], np.ndarray],
],
validated_value,
)


# TEST: Consider adding unit tests for this function.
Expand Down Expand Up @@ -492,7 +501,7 @@ def fourByFour_number_arrayLike_return_float(value: Any, name: str) -> np.ndarra


# TEST: Consider adding unit tests for this function.
def non_empty_list_return_list(value: Any, name: str) -> list:
def non_empty_list_return_list(value: Any, name: str) -> list[Any]:
"""Validates a value is a non empty list and returns it.

:param value: The value to validate.
Expand Down
4 changes: 3 additions & 1 deletion pterasoftware/geometry/airplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ def draw(
transparent_background=True,
return_img=True,
)
image = webp.Image.fromarray(cast(np.ndarray[Any, Any], screenshot))
image = webp.Image.fromarray(
cast(np.ndarray[Any, Any], screenshot),
)
webp.save_image(
img=image,
file_path=f"{self.name}_geometry.webp",
Expand Down
2 changes: 1 addition & 1 deletion pterasoftware/movements/_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def oscillating_customspaces(
bases: float | int | np.ndarray | Sequence[float | int],
num_steps: int,
delta_time: float | int,
custom_function: Callable,
custom_function: Callable[[np.ndarray], np.ndarray],
) -> np.ndarray:
"""Returns a (...,num_steps) ndarray of floats calculated by inputting a vector of
linearly spaced time steps into a custom oscillating function defined with the
Expand Down
4 changes: 3 additions & 1 deletion pterasoftware/movements/airplane_movement.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ def __init__(
wing_movements: list[wing_movement_mod.WingMovement],
ampCg_GP1_CgP1: np.ndarray | Sequence[float | int] = (0.0, 0.0, 0.0),
periodCg_GP1_CgP1: np.ndarray | Sequence[float | int] = (0.0, 0.0, 0.0),
spacingCg_GP1_CgP1: np.ndarray | Sequence[str | Callable] = (
spacingCg_GP1_CgP1: (
np.ndarray | Sequence[str | Callable[[np.ndarray], np.ndarray]]
) = (
"sine",
"sine",
"sine",
Expand Down
4 changes: 3 additions & 1 deletion pterasoftware/movements/operating_point_movement.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

from collections.abc import Callable

import numpy as np

from . import _functions

from .. import operating_point as operating_point_mod
Expand All @@ -35,7 +37,7 @@ def __init__(
base_operating_point: operating_point_mod.OperatingPoint,
ampVCg__E: float | int = 0.0,
periodVCg__E: float | int = 0.0,
spacingVCg__E: str | Callable = "sine",
spacingVCg__E: str | Callable[[np.ndarray], np.ndarray] = "sine",
phaseVCg__E: float | int = 0.0,
) -> None:
"""The initialization method.
Expand Down
8 changes: 6 additions & 2 deletions pterasoftware/movements/wing_cross_section_movement.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ def __init__(
base_wing_cross_section: geometry.wing_cross_section.WingCrossSection,
ampLp_Wcsp_Lpp: np.ndarray | Sequence[float | int] = (0.0, 0.0, 0.0),
periodLp_Wcsp_Lpp: np.ndarray | Sequence[float | int] = (0.0, 0.0, 0.0),
spacingLp_Wcsp_Lpp: np.ndarray | Sequence[str | Callable] = (
spacingLp_Wcsp_Lpp: (
np.ndarray | Sequence[str | Callable[[np.ndarray], np.ndarray]]
) = (
"sine",
"sine",
"sine",
Expand All @@ -53,7 +55,9 @@ def __init__(
0.0,
0.0,
),
spacingAngles_Wcsp_to_Wcs_ixyz: np.ndarray | Sequence[str | Callable] = (
spacingAngles_Wcsp_to_Wcs_ixyz: (
np.ndarray | Sequence[str | Callable[[np.ndarray], np.ndarray]]
) = (
"sine",
"sine",
"sine",
Expand Down
8 changes: 6 additions & 2 deletions pterasoftware/movements/wing_movement.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def __init__(
],
ampLer_Gs_Cgs: np.ndarray | Sequence[float | int] = (0.0, 0.0, 0.0),
periodLer_Gs_Cgs: np.ndarray | Sequence[float | int] = (0.0, 0.0, 0.0),
spacingLer_Gs_Cgs: np.ndarray | Sequence[str | Callable] = (
spacingLer_Gs_Cgs: (
np.ndarray | Sequence[str | Callable[[np.ndarray], np.ndarray]]
) = (
"sine",
"sine",
"sine",
Expand All @@ -62,7 +64,9 @@ def __init__(
0.0,
0.0,
),
spacingAngles_Gs_to_Wn_ixyz: np.ndarray | Sequence[str | Callable] = (
spacingAngles_Gs_to_Wn_ixyz: (
np.ndarray | Sequence[str | Callable[[np.ndarray], np.ndarray]]
) = (
"sine",
"sine",
"sine",
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = PteraSoftware
version = 3.2.0
version = 4.0.0
author = Cameron Urban
author_email = camerongurban@gmail.com
license = MIT
Expand Down