Skip to content

Commit

Permalink
Merge branch 'main' into admin/ci
Browse files Browse the repository at this point in the history
  • Loading branch information
janbridley authored Oct 14, 2024
2 parents 648056a + 5fc4786 commit 74f1375
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tests/data/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class TestCustomGenerator:
def n(self, request):
return request.param

@pytest.fixture()
@pytest.fixture
def function(self, n):
if n == 0:

Expand All @@ -28,7 +28,7 @@ def func(a, b):

return func

@pytest.fixture()
@pytest.fixture
def generator(self, function):
return du.data.base.CustomGenerator(function)

Expand Down
12 changes: 6 additions & 6 deletions tests/data/test_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: {}

Expand All @@ -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}

Expand All @@ -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 {
Expand Down Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions tests/data/test_reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
4 changes: 2 additions & 2 deletions tests/preprocessing/test_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions tests/preprocessing/test_supervised.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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))

Expand Down

0 comments on commit 74f1375

Please sign in to comment.