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

Fixed benchmarks for regridding.regrid(). #2

Merged
merged 1 commit into from
Dec 4, 2023
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
20 changes: 10 additions & 10 deletions benchmarks/regrid.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import numpy as np
import regridding

vertices_input = None
vertices_output = None
coordinates_input = None
coordinates_output = None
values_input = None


Expand All @@ -25,17 +25,17 @@ def setup_regrid_2d(
y_output = np.linspace(y_input.min(), y_input.max(), num=num_y)
x_output, y_output = np.meshgrid(x_output, y_output, indexing="ij")

global vertices_input
global vertices_output
global coordinates_input
global coordinates_output
global values_input

vertices_input = (x_input, y_input)
vertices_output = (x_output, y_output)
coordinates_input = (x_input, y_input)
coordinates_output = (x_output, y_output)
values_input = np.random.uniform(0, 1, size=(num_x - 1, num_y - 1))

regridding.regrid(
vertices_input=vertices_input,
vertices_output=vertices_output,
coordinates_input=coordinates_input,
coordinates_output=coordinates_output,
values_input=values_input,
method=method,
order=order,
Expand All @@ -48,8 +48,8 @@ def time_regrid_2d(
order: int,
):
regridding.regrid(
vertices_input=vertices_input,
vertices_output=vertices_output,
coordinates_input=coordinates_input,
coordinates_output=coordinates_output,
values_input=values_input,
method=method,
order=order,
Expand Down
Loading