Skip to content

Commit

Permalink
formatting update
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobdparker committed Apr 15, 2024
1 parent 399a23b commit 8934c2c
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions regridding/_regrid/_regrid_from_weights.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@


def regrid_from_weights(
weights: np.ndarray,
shape_input: tuple[int, ...],
shape_output: tuple[int, ...],
values_input: np.ndarray,
values_output: None | np.ndarray = None,
axis_input: None | int | Sequence[int] = None,
axis_output: None | int | Sequence[int] = None,
weights: np.ndarray,
shape_input: tuple[int, ...],
shape_output: tuple[int, ...],
values_input: np.ndarray,
values_output: None | np.ndarray = None,
axis_input: None | int | Sequence[int] = None,
axis_output: None | int | Sequence[int] = None,
) -> np.ndarray:
"""
Regrid an array of values using weights computed by
Expand Down Expand Up @@ -91,7 +91,6 @@ def regrid_from_weights(

ndim_output = len(shape_output)
axis_output = _util._normalize_axis(axis_output, ndim=ndim_output)
print(f'{axis_output=}')

axis_input_numba = ~np.arange(len(axis_input))[::-1]
axis_output_numba = ~np.arange(len(axis_output))[::-1]
Expand All @@ -112,9 +111,6 @@ def regrid_from_weights(
values_input = np.ascontiguousarray(values_input)
values_output = np.ascontiguousarray(values_output)

print(f'{values_input.shape=}')
print(f'{values_output.shape=}')

_regrid_from_weights(
weights=weights,
values_input=values_input,
Expand All @@ -130,9 +126,9 @@ def regrid_from_weights(

@numba.njit(parallel=True)
def _regrid_from_weights(
weights: numba.typed.List,
values_input: np.ndarray,
values_output: np.ndarray,
weights: numba.typed.List,
values_input: np.ndarray,
values_output: np.ndarray,
) -> None:

for d in numba.prange(len(weights)):
Expand Down

0 comments on commit 8934c2c

Please sign in to comment.