Skip to content

Commit

Permalink
ci: pre-commit autoupdate (#119)
Browse files Browse the repository at this point in the history
* ci: pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.5.0 → v0.5.1](astral-sh/ruff-pre-commit@v0.5.0...v0.5.1)

* ci: auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jul 10, 2024
1 parent 42c5d60 commit 906ab43
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ repos:
# Similar to: https://stackoverflow.com/a/73603491/5755604
additional_dependencies: ['types-PyYAML']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
rev: v0.5.1
hooks:
- id: ruff
args:
Expand Down
30 changes: 15 additions & 15 deletions tests/test_classical_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TestClassicalClassifier:
unittest (_type_): unittest module
"""

@pytest.fixture()
@pytest.fixture
def x_train(self) -> pd.DataFrame:
"""Training set fixture.
Expand All @@ -47,7 +47,7 @@ def x_train(self) -> pd.DataFrame:
],
)

@pytest.fixture()
@pytest.fixture
def x_test(self) -> pd.DataFrame:
"""Test set fixture.
Expand All @@ -58,7 +58,7 @@ def x_test(self) -> pd.DataFrame:
[[1, 2], [3, 4], [1, 2], [3, 4]], columns=["ask_best", "bid_best"]
)

@pytest.fixture()
@pytest.fixture
def y_test(self) -> pd.Series:
"""Test target fixture.
Expand All @@ -67,7 +67,7 @@ def y_test(self) -> pd.Series:
"""
return pd.Series([1, -1, 1, -1])

@pytest.fixture()
@pytest.fixture
def clf(self, x_train: pd.DataFrame) -> ClassicalClassifier:
"""Classifier fixture with random classification.
Expand Down Expand Up @@ -304,7 +304,7 @@ def _apply_rule(
)
assert (y_pred == y_test).all()

@pytest.mark.benchmark()
@pytest.mark.benchmark
@pytest.mark.parametrize("subset", ["all", "ex"])
def test_tick_rule(self, x_train: pd.DataFrame, subset: str) -> None:
"""Test, if tick rule is correctly applied.
Expand All @@ -324,7 +324,7 @@ def test_tick_rule(self, x_train: pd.DataFrame, subset: str) -> None:
y_test = pd.Series([-1, 1, 1, -1])
self._apply_rule(x_train, x_test, y_test, [("tick", subset)], 7)

@pytest.mark.benchmark()
@pytest.mark.benchmark
@pytest.mark.parametrize("subset", ["all", "ex"])
def test_rev_tick_rule(self, x_train: pd.DataFrame, subset: str) -> None:
"""Test, if rev. tick rule is correctly applied.
Expand All @@ -343,7 +343,7 @@ def test_rev_tick_rule(self, x_train: pd.DataFrame, subset: str) -> None:
y_test = pd.Series([-1, 1, 1, -1])
self._apply_rule(x_train, x_test, y_test, [("rev_tick", subset)], 7)

@pytest.mark.benchmark()
@pytest.mark.benchmark
@pytest.mark.parametrize("subset", ["best", "ex"])
def test_quote_rule(self, x_train: pd.DataFrame, subset: str) -> None:
"""Test, if quote rule is correctly applied.
Expand All @@ -369,7 +369,7 @@ def test_quote_rule(self, x_train: pd.DataFrame, subset: str) -> None:
y_test = pd.Series([-1, 1, 1, -1, -1, 1])
self._apply_rule(x_train, x_test, y_test, [("quote", subset)], 45)

@pytest.mark.benchmark()
@pytest.mark.benchmark
@pytest.mark.parametrize("subset", ["best", "ex"])
def test_lr(self, x_train: pd.DataFrame, subset: str) -> None:
"""Test, if the lr algorithm is correctly applied.
Expand All @@ -393,7 +393,7 @@ def test_lr(self, x_train: pd.DataFrame, subset: str) -> None:
y_test = pd.Series([-1, 1, 1, -1])
self._apply_rule(x_train, x_test, y_test, [("lr", subset)], 7)

@pytest.mark.benchmark()
@pytest.mark.benchmark
@pytest.mark.parametrize("subset", ["best", "ex"])
def test_rev_lr(self, x_train: pd.DataFrame, subset: str) -> None:
"""Test, if the rev. lr algorithm is correctly applied.
Expand Down Expand Up @@ -424,7 +424,7 @@ def test_rev_lr(self, x_train: pd.DataFrame, subset: str) -> None:
y_test = pd.Series([-1, 1, 1, -1, -1, 1])
self._apply_rule(x_train, x_test, y_test, [("rev_lr", subset)], 42)

@pytest.mark.benchmark()
@pytest.mark.benchmark
@pytest.mark.parametrize("subset", ["best", "ex"])
def test_emo(self, x_train: pd.DataFrame, subset: str) -> None:
"""Test, if the emo algorithm is correctly applied.
Expand Down Expand Up @@ -455,7 +455,7 @@ def test_emo(self, x_train: pd.DataFrame, subset: str) -> None:
y_test = pd.Series([-1, 1, 1, -1, -1, 1])
self._apply_rule(x_train, x_test, y_test, [("emo", subset)], 42)

@pytest.mark.benchmark()
@pytest.mark.benchmark
@pytest.mark.parametrize("subset", ["best", "ex"])
def test_rev_emo(self, x_train: pd.DataFrame, subset: str) -> None:
"""Test, if the rev. emo algorithm is correctly applied.
Expand Down Expand Up @@ -486,7 +486,7 @@ def test_rev_emo(self, x_train: pd.DataFrame, subset: str) -> None:
y_test = pd.Series([-1, 1, 1, -1, -1, 1])
self._apply_rule(x_train, x_test, y_test, [("rev_emo", subset)], 42)

@pytest.mark.benchmark()
@pytest.mark.benchmark
@pytest.mark.parametrize("subset", ["best", "ex"])
def test_clnv(self, x_train: pd.DataFrame, subset: str) -> None:
"""Test, if the clnv algorithm is correctly applied.
Expand Down Expand Up @@ -517,7 +517,7 @@ def test_clnv(self, x_train: pd.DataFrame, subset: str) -> None:
y_test = pd.Series([1, -1, 1, -1, 1, -1])
self._apply_rule(x_train, x_test, y_test, [("clnv", subset)], 42)

@pytest.mark.benchmark()
@pytest.mark.benchmark
@pytest.mark.parametrize("subset", ["best", "ex"])
def test_rev_clnv(self, x_train: pd.DataFrame, subset: str) -> None:
"""Test, if the rev. clnv algorithm is correctly applied.
Expand Down Expand Up @@ -547,7 +547,7 @@ def test_rev_clnv(self, x_train: pd.DataFrame, subset: str) -> None:
y_test = pd.Series([1, -1, 1, -1, 1, -1])
self._apply_rule(x_train, x_test, y_test, [("rev_clnv", subset)], 5)

@pytest.mark.benchmark()
@pytest.mark.benchmark
def test_trade_size(self, x_train: pd.DataFrame) -> None:
"""Test, if the trade size algorithm is correctly applied.
Expand All @@ -568,7 +568,7 @@ def test_trade_size(self, x_train: pd.DataFrame) -> None:
y_test = pd.Series([-1, 1, -1, 1, -1, 1])
self._apply_rule(x_train, x_test, y_test, [("trade_size", "ex")], 42)

@pytest.mark.benchmark()
@pytest.mark.benchmark
def test_depth(self, x_train: pd.DataFrame) -> None:
"""Test, if the depth rule is correctly applied.
Expand Down

0 comments on commit 906ab43

Please sign in to comment.