Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-wilkins committed Jan 9, 2025
1 parent c7808a7 commit ba34141
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions sasdata/transforms/rebinning.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def calculate_interpolation_matrix_1d(input_axis: Quantity[ArrayLike],

if mask is None:
return conversion_matrix, None

else:
# Create a new mask

Expand Down
6 changes: 3 additions & 3 deletions sasdata/transforms/test_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_linear_interpolate_matrix_inside(fun: Callable[[Quantity[ArrayLike]], Q
test_points = NamedQuantity("x_test", np.linspace(-5, 5, 11), units.meters)


mapping = calculate_interpolation_matrix_1d(original_points, test_points, order=InterpolationOptions.LINEAR)
mapping, _ = calculate_interpolation_matrix_1d(original_points, test_points, order=InterpolationOptions.LINEAR)

y_original = fun(original_points)
y_test = y_original @ mapping
Expand Down Expand Up @@ -53,7 +53,7 @@ def test_linear_interpolate_different_units(fun: Callable[[Quantity[ArrayLike]],
original_points = NamedQuantity("x_base", np.linspace(-10,10, 107), units.meters)
test_points = NamedQuantity("x_test", np.linspace(-5000, 5000, 11), units.millimeters)

mapping = calculate_interpolation_matrix_1d(original_points, test_points, order=InterpolationOptions.LINEAR)
mapping, _ = calculate_interpolation_matrix_1d(original_points, test_points, order=InterpolationOptions.LINEAR)

y_original = fun(original_points)
y_test = y_original @ mapping
Expand Down Expand Up @@ -83,7 +83,7 @@ def test_linearity_linear():
x_and_y = NamedQuantity("x_base", np.linspace(-10, 10, 2), units.meters)
new_x = NamedQuantity("x_test", np.linspace(-5000, 5000, 101), units.millimeters)

mapping = calculate_interpolation_matrix_1d(x_and_y, new_x, order=InterpolationOptions.LINEAR)
mapping, _ = calculate_interpolation_matrix_1d(x_and_y, new_x, order=InterpolationOptions.LINEAR)

linear_points = x_and_y @ mapping

Expand Down

0 comments on commit ba34141

Please sign in to comment.