Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add return hints #28

Merged
merged 2 commits into from
Sep 3, 2024
Merged
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
24 changes: 12 additions & 12 deletions exponax/stepper/generic/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def normalize_gradient_norm_scale(
*,
domain_extent: float,
dt: float,
):
) -> float:
"""
Normalize the scale in front of the gradient norm term to be used with the
normalized generic steppers.
Expand Down Expand Up @@ -157,7 +157,7 @@ def denormalize_gradient_norm_scale(
*,
domain_extent: float,
dt: float,
):
) -> float:
"""
Denormalize the scale in front of the gradient norm term as it was used in
the normalized generic steppers to then be used again in a generic stepper
Expand All @@ -184,11 +184,11 @@ def denormalize_gradient_norm_scale(


def normalize_polynomial_scales(
polynomial_scales: tuple[float],
polynomial_scales: tuple[float, ...],
*,
domain_extent: float = None,
dt: float,
) -> tuple[float]:
) -> tuple[float, ...]:
"""
Normalize the polynomial scales to be used with the normalized polynomial
stepper.
Expand Down Expand Up @@ -243,7 +243,7 @@ def reduce_normalized_coefficients_to_difficulty(
*,
num_spatial_dims: int,
num_points: int,
):
) -> tuple[float, ...]:
"""
Reduce the normalized coefficients for a linear operator to a difficulty
based interface. This interface is designed to "reduce the intensity of the
Expand Down Expand Up @@ -284,7 +284,7 @@ def extract_normalized_coefficients_from_difficulty(
*,
num_spatial_dims: int,
num_points: int,
):
) -> tuple[float, ...]:
"""
Extract the normalized coefficients for a linear operator from a difficulty
based interface.
Expand Down Expand Up @@ -322,7 +322,7 @@ def reduce_normalized_convection_scale_to_difficulty(
num_spatial_dims: int,
num_points: int,
maximum_absolute: float,
):
) -> float:
"""
Reduce the normalized convection scale to a difficulty based interface.

Expand Down Expand Up @@ -354,7 +354,7 @@ def extract_normalized_convection_scale_from_difficulty(
num_spatial_dims: int,
num_points: int,
maximum_absolute: float,
):
) -> float:
"""
Extract the normalized convection scale from a difficulty based interface.

Expand Down Expand Up @@ -386,7 +386,7 @@ def reduce_normalized_gradient_norm_scale_to_difficulty(
num_spatial_dims: int,
num_points: int,
maximum_absolute: float,
):
) -> float:
"""
Reduce the normalized gradient norm scale to a difficulty based interface.

Expand Down Expand Up @@ -421,7 +421,7 @@ def extract_normalized_gradient_norm_scale_from_difficulty(
num_spatial_dims: int,
num_points: int,
maximum_absolute: float,
):
) -> float:
"""
Extract the normalized gradient norm scale from a difficulty based interface.

Expand Down Expand Up @@ -453,7 +453,7 @@ def reduce_normalized_nonlinear_scales_to_difficulty(
num_spatial_dims: int,
num_points: int,
maximum_absolute: float,
):
) -> tuple[float, float, float]:
"""
Reduce the normalized nonlinear scales associated with a quadratic, a
(single-channel) convection term, and a gradient norm term to a difficulty
Expand Down Expand Up @@ -506,7 +506,7 @@ def extract_normalized_nonlinear_scales_from_difficulty(
num_spatial_dims: int,
num_points: int,
maximum_absolute: float,
):
) -> tuple[float, float, float]:
"""
Extract the normalized nonlinear scales associated with a quadratic, a
(single-channel) convection term, and a gradient norm term from a difficulty
Expand Down
Loading