From 6170e3dad6f1e5f5282a23a2a25b3b8b9961b1d8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 17:13:31 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0) - [github.com/astral-sh/ruff-pre-commit: v0.5.0 → v0.6.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.0...v0.6.9) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c8aff14..728e4e2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ ci: autofix_prs: false repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -21,7 +21,7 @@ repos: - --keep-count - --keep-output - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.0 + rev: v0.6.9 hooks: - id: ruff args: From 19c1f3314503b5e25af5377f8f3d89d04a40a8c2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 17:13:38 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/data/test_base.py | 4 ++-- tests/data/test_map.py | 12 ++++++------ tests/data/test_reduce.py | 4 ++-- tests/preprocessing/test_filter.py | 4 ++-- tests/preprocessing/test_supervised.py | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/data/test_base.py b/tests/data/test_base.py index 6806d64..25b50fa 100644 --- a/tests/data/test_base.py +++ b/tests/data/test_base.py @@ -9,7 +9,7 @@ class TestCustomGenerator: def n(self, request): return request.param - @pytest.fixture() + @pytest.fixture def function(self, n): if n == 0: @@ -28,7 +28,7 @@ def func(a, b): return func - @pytest.fixture() + @pytest.fixture def generator(self, function): return du.data.base.CustomGenerator(function) diff --git a/tests/data/test_map.py b/tests/data/test_map.py index 24d85e4..cd10678 100644 --- a/tests/data/test_map.py +++ b/tests/data/test_map.py @@ -14,14 +14,14 @@ class BaseMapTest: cls = None - @pytest.fixture() + @pytest.fixture def generator(self): return du.data.freud.FreudDescriptor( freud.order.Steinhardt(l=SPH_HARM_NUMBER), {"particle_order": [str(sph_harm) for sph_harm in SPH_HARM_NUMBER]}, ) - @pytest.fixture() + @pytest.fixture def valid_spec(self): # noqa: PT004 """Return a valid spec.""" raise NotImplementedError @@ -92,7 +92,7 @@ def validate_output(output, compute_arr, passed_args): class TestIdentity(BaseMapTest): cls = du.data.map.Identity - @pytest.fixture() + @pytest.fixture def valid_spec(self): return lambda: {} @@ -105,7 +105,7 @@ def validate_output(output, compute_arr, passed_args): class TestSpatialAveraging(BaseMapTest): cls = du.data.spatial.NeighborAveraging - @pytest.fixture() + @pytest.fixture def valid_spec(self): return lambda: {"expected_kwarg": "neighbors", "remove_kwarg": False} @@ -131,7 +131,7 @@ def validate_output(output, compute_arr, passed_args): class TestTee(BaseMapTest): cls = du.data.map.Tee - @pytest.fixture() + @pytest.fixture def valid_spec(self): def spec(): return { @@ -160,7 +160,7 @@ def validate_output(output, compute_arr, passed_args): class TestCustomMap(BaseMapTest): cls = du.data.base.CustomMap - @pytest.fixture() + @pytest.fixture def valid_spec(self): def double(arr): return {"doubled": arr * 2} diff --git a/tests/data/test_reduce.py b/tests/data/test_reduce.py index 143a4bc..dd28f43 100644 --- a/tests/data/test_reduce.py +++ b/tests/data/test_reduce.py @@ -35,11 +35,11 @@ def _pairwise(a): def add_reducer_tests(cls, validator): class TestReducer: - @pytest.fixture() + @pytest.fixture def constructor_args(self): return validator.constructor_args - @pytest.fixture() + @pytest.fixture def base_generator(self): @du.data.make_generator def generator(): diff --git a/tests/preprocessing/test_filter.py b/tests/preprocessing/test_filter.py index d3eca0c..bd61605 100644 --- a/tests/preprocessing/test_filter.py +++ b/tests/preprocessing/test_filter.py @@ -14,7 +14,7 @@ class TestMeanShift: def get_shift_range(self, min_, max_): return (min_ * self.min_mean_shift, max_ * self.min_mean_shift) - @pytest.fixture() + @pytest.fixture def mean_shift(self): return du.preprocessing.filter.MeanShift(self.sensitivity) @@ -155,7 +155,7 @@ def check_equivalent_labels(self, a, b): for i, j in map_.items(): assert not np.any((a == i) != (b == j)) - @pytest.fixture() + @pytest.fixture def correlated(self): return du.preprocessing.filter.Correlated(max_clusters=5) diff --git a/tests/preprocessing/test_supervised.py b/tests/preprocessing/test_supervised.py index 360895f..45217eb 100644 --- a/tests/preprocessing/test_supervised.py +++ b/tests/preprocessing/test_supervised.py @@ -82,7 +82,7 @@ def signal_with_mean_shift(seeds): return rpt.pw_constant(100, 2, 1, 0.5, delta=(3, 5), seed=seeds()) -@pytest.fixture() +@pytest.fixture def window(): classifier = sk.tree.DecisionTreeClassifier(max_depth=1) return du.preprocessing.supervised.Window( @@ -97,7 +97,7 @@ def test_compute(window, signal_with_mean_shift): assert abs(error.argmin() - change_point[0]) <= max_allowed_error -@pytest.fixture() +@pytest.fixture def random_signal(rng): return rng.uniform(-500_000, 500_000, size=20).reshape((-1, 1))