Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,13 @@ def _compute_rbf_interpolation_coeffs(
edge_normal_x: data_alloc.NDArray,
edge_normal_y: data_alloc.NDArray,
edge_normal_z: data_alloc.NDArray,
uv: list[tuple[data_alloc.NDArray, data_alloc.NDArray]],
uv: tuple[tuple[data_alloc.NDArray, data_alloc.NDArray], ...],
rbf_offset: data_alloc.NDArray,
rbf_kernel: InterpolationKernel,
scale_factor: ta.wpfloat,
horizontal_start: gtx.int32,
array_ns: ModuleType = np,
) -> tuple[data_alloc.NDArray, data_alloc.NDArray]:
) -> tuple[data_alloc.NDArray, ...]:
rbf_offset_shape_full = rbf_offset.shape
rbf_offset = rbf_offset[horizontal_start:]
num_elements = rbf_offset.shape[0]
Expand Down Expand Up @@ -375,11 +375,11 @@ def compute_rbf_interpolation_coeffs_cell(
scale_factor: ta.wpfloat,
horizontal_start: gtx.int32,
array_ns: ModuleType = np,
) -> tuple[data_alloc.NDArray, data_alloc.NDArray]:
) -> tuple[data_alloc.NDArray]:
zeros = array_ns.zeros(rbf_offset.shape[0], dtype=ta.wpfloat)
ones = array_ns.ones(rbf_offset.shape[0], dtype=ta.wpfloat)

coeffs = _compute_rbf_interpolation_coeffs(
return _compute_rbf_interpolation_coeffs(
cell_center_lat,
cell_center_lon,
cell_center_x,
Expand All @@ -391,15 +391,13 @@ def compute_rbf_interpolation_coeffs_cell(
edge_normal_x,
edge_normal_y,
edge_normal_z,
[(ones, zeros), (zeros, ones)],
((ones, zeros), (zeros, ones)),
rbf_offset,
InterpolationKernel(rbf_kernel),
scale_factor,
horizontal_start,
array_ns=array_ns,
)
assert len(coeffs) == 2
return coeffs


def compute_rbf_interpolation_coeffs_edge(
Expand All @@ -419,7 +417,7 @@ def compute_rbf_interpolation_coeffs_edge(
horizontal_start: gtx.int32,
array_ns: ModuleType = np,
) -> data_alloc.NDArray:
coeffs = _compute_rbf_interpolation_coeffs(
return _compute_rbf_interpolation_coeffs(
edge_lat,
edge_lon,
edge_center_x,
Expand All @@ -431,15 +429,13 @@ def compute_rbf_interpolation_coeffs_edge(
edge_normal_x,
edge_normal_y,
edge_normal_z,
[(edge_dual_normal_u, edge_dual_normal_v)],
((edge_dual_normal_u, edge_dual_normal_v),),
rbf_offset,
InterpolationKernel(rbf_kernel),
scale_factor,
horizontal_start,
array_ns=array_ns,
)
assert len(coeffs) == 1
return coeffs[0]
)[0]


def compute_rbf_interpolation_coeffs_vertex(
Expand All @@ -463,7 +459,7 @@ def compute_rbf_interpolation_coeffs_vertex(
zeros = array_ns.zeros(rbf_offset.shape[0], dtype=ta.wpfloat)
ones = array_ns.ones(rbf_offset.shape[0], dtype=ta.wpfloat)

coeffs = _compute_rbf_interpolation_coeffs(
return _compute_rbf_interpolation_coeffs(
vertex_lat,
vertex_lon,
vertex_x,
Expand All @@ -475,12 +471,10 @@ def compute_rbf_interpolation_coeffs_vertex(
edge_normal_x,
edge_normal_y,
edge_normal_z,
[(ones, zeros), (zeros, ones)],
((ones, zeros), (zeros, ones)),
rbf_offset,
InterpolationKernel(rbf_kernel),
scale_factor,
horizontal_start,
array_ns=array_ns,
)
assert len(coeffs) == 2
return coeffs