Skip to content

Commit

Permalink
Add type hints (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceyron authored Sep 3, 2024
1 parent 3cf1399 commit 96a1116
Showing 1 changed file with 12 additions and 12 deletions.
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

0 comments on commit 96a1116

Please sign in to comment.