Skip to content

Commit bc3b8e8

Browse files
committed
MAINT: Fix linting errors
Also updated ruffs rules.
1 parent 3c0b8a4 commit bc3b8e8

File tree

10 files changed

+6
-8
lines changed

10 files changed

+6
-8
lines changed

.github/workflows/python-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ jobs:
110110
run: python -m pip install ruff
111111

112112
- name: Lint
113-
run: ruff check . --show-source
113+
run: ruff check .

pybaselines/classification.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,6 @@ def fabc(self, data, lam=1e6, scale=None, num_std=3.0, diff_order=2, min_length=
805805

806806
return baseline, params
807807

808-
809808
@_Algorithm._register(sort_keys=('mask',))
810809
def rubberband(self, data, segments=1, lam=None, diff_order=2, weights=None,
811810
smooth_half_window=None, **pad_kwargs):

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ known_local_folder = ["example_helpers"]
9898
exclude = ["docs/*"]
9999
line-length = 100
100100
fix = false
101+
output-format = "full"
101102

102103
[tool.ruff.lint]
103104
preview = true # for using experimental rules

requirements/requirements-development.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
-r requirements-documentation.txt
33

44
# for linting
5-
ruff==0.2.1
5+
ruff==0.2.2
66

77
# for testing
88
pytest==8.0.0

tests/test_algorithm_setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,6 @@ def func2(self, data, *args, **kwargs):
626626
}
627627
return 1 * data, params
628628

629-
630629
if change_order:
631630
x[sort_indices] = x[sort_indices][::-1]
632631
y[sort_indices] = y[sort_indices][::-1]

tests/test_banded_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ def test_diff_penalty_diagonals_datasize_too_small():
107107
_banded_utils.diff_penalty_diagonals(-1)
108108

109109

110-
111110
@pytest.mark.parametrize('data_size', (10, 51))
112111
@pytest.mark.parametrize('diff_order', (1, 2, 3, 4))
113112
def test_diff_penalty_matrix(data_size, diff_order):
@@ -452,7 +451,6 @@ def check_penalized_system(penalized_system, expected_penalty, lam, diff_order,
452451
)
453452

454453

455-
456454
@pytest.mark.parametrize('diff_order', (1, 2, 3))
457455
@pytest.mark.parametrize('allow_lower', (True, False))
458456
@pytest.mark.parametrize('reverse_diags', (None, True, False))

tests/test_meta.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,6 @@ def test_setup(self):
409409
assert self.param_keys == []
410410
assert self.two_d
411411

412-
413412
def test_reverse_array(self):
414413
"""Ensures the reverse_array funcion works correctly."""
415414
assert_allclose(self.reverse_array(self.y), self.y[..., ::-1])

tests/test_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def test_gaussian(_x_data, height, center, sigma):
4040
gaussian(_x_data, height, center, sigma), 1e-12, 1e-12
4141
)
4242

43+
4344
@pytest.mark.parametrize('sigma', (0, -1))
4445
def test_gaussian_non_positive_sigma(_x_data, sigma):
4546
"""Ensures a sigma value not greater than 0 raises an exception."""

tests/test_validation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def test_yx_arrays_no_x(small_data):
3838
assert isinstance(y, np.ndarray)
3939
assert_allclose(y, small_data, rtol=1e-12, atol=1e-12)
4040

41+
4142
@pytest.mark.parametrize('array_enum', (0, 1))
4243
def test_yxz_arrays_output_array(data_fixture2d, array_enum):
4344
"""Ensures output y, x, and z are always numpy arrays and that x and z are not scaled."""
@@ -343,6 +344,7 @@ def test_check_half_window_failures():
343344
with pytest.raises(TypeError):
344345
_validation._check_half_window(5.01)
345346

347+
346348
@pytest.mark.parametrize(
347349
'half_window', (
348350
5, 5.0, [5], (5,), [[5]], np.array(5), np.array([5]), np.array([[5]]),

tests/two_d/test_spline.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ def test_diff_order_one_fails(self):
189189
with pytest.raises(ValueError):
190190
self.class_func(self.y, diff_order=[2, 1])
191191

192-
193192
@pytest.mark.parametrize('lam', (1e1, 1e5, [1e1, 1e5]))
194193
@pytest.mark.parametrize('lam_1', (1e1, [1e1, 1e5]))
195194
@pytest.mark.parametrize('p', (0.01, 0.1))

0 commit comments

Comments
 (0)