Skip to content

Commit

Permalink
format tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paucablop committed Jan 26, 2025
1 parent f005cb3 commit 020e4f7
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions tests/test_functionality.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,12 @@ def test_index_selector_with_wavenumbers_and_dataframe():
def test_index_shift_constant_fill():
# Arrange
spectrum = np.array([[5, 4, 3, 2, 1, 2, 1, 2, 3, 4, 5]])
spectrum_positive_shift = IndexShift(shift=1, fill_method="constant", random_state=44)
spectrum_negative_shift = IndexShift(shift=1, fill_method="constant", random_state=42)
spectrum_positive_shift = IndexShift(
shift=1, fill_method="constant", random_state=44
)
spectrum_negative_shift = IndexShift(
shift=1, fill_method="constant", random_state=42
)

# Act
spectrum_positive_shifted = spectrum_positive_shift.fit_transform(spectrum)
Expand Down Expand Up @@ -318,11 +322,16 @@ def test_index_shift_linear_fill():
assert np.isclose(spectrum_positive_shifted[0][0], 6.0, atol=1e-6)
assert np.isclose(spectrum_negative_shifted[0][-1], 6.0, atol=1e-6)


def test_index_shift_quadratic_fill():
# Arrange
spectrum = np.array([[5, 4, 3, 2, 1, 2, 1, 4, 9, 16, 25]])
spectrum_positive_shift = IndexShift(shift=1, fill_method="quadratic", random_state=44)
spectrum_negative_shift = IndexShift(shift=1, fill_method="quadratic", random_state=42)
spectrum_positive_shift = IndexShift(
shift=1, fill_method="quadratic", random_state=44
)
spectrum_negative_shift = IndexShift(
shift=1, fill_method="quadratic", random_state=42
)

# Act
spectrum_positive_shifted = spectrum_positive_shift.fit_transform(spectrum)
Expand All @@ -334,6 +343,7 @@ def test_index_shift_quadratic_fill():
assert np.isclose(spectrum_positive_shifted[0][0], 6.0, atol=1e-6)
assert np.isclose(spectrum_negative_shifted[0][-1], 36.0, atol=1e-6)


def test_l1_norm(spectrum):
# Arrange
norm = 1
Expand Down

0 comments on commit 020e4f7

Please sign in to comment.