Skip to content

Commit

Permalink
format rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
tachyonicClock committed Jan 31, 2025
1 parent 3ee6193 commit 7b15fb8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
12 changes: 6 additions & 6 deletions tests/test_classifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,12 @@ def test_classifiers(test_case: ClassifierTestCase, subtests: SubTests):
print(f"{actual_acc}")
print(f"{actual_win_acc}")

assert (
actual_acc == pytest.approx(test_case.accuracy, abs=0.1)
), f"Basic Eval: Expected accuracy of {test_case.accuracy:0.1f} got {actual_acc: 0.1f}"
assert (
actual_win_acc == pytest.approx(test_case.win_accuracy, abs=0.1)
), f"Windowed Eval: Expected accuracy of {test_case.win_accuracy:0.1f} got {actual_win_acc:0.1f}"
assert actual_acc == pytest.approx(test_case.accuracy, abs=0.1), (
f"Basic Eval: Expected accuracy of {test_case.accuracy:0.1f} got {actual_acc: 0.1f}"
)
assert actual_win_acc == pytest.approx(test_case.win_accuracy, abs=0.1), (
f"Windowed Eval: Expected accuracy of {test_case.win_accuracy:0.1f} got {actual_win_acc:0.1f}"
)

# Check if the classifier can be saved and loaded
with subtests.test(msg="save_and_load"):
Expand Down
1 change: 0 additions & 1 deletion tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from capymoa.datasets import ElectricityTiny
from capymoa.misc import legacy_save_model, legacy_load_model, load_model
from tempfile import TemporaryDirectory
from jpype import JException
import pytest


Expand Down
12 changes: 6 additions & 6 deletions tests/test_regressors.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ def test_regressor(subtests: SubTests, learner_constructor, rmse, win_rmse):

actual_rmse = evaluator.rmse()
actual_win_rmse = win_evaluator.rmse()[-1]
assert actual_rmse == pytest.approx(
rmse, abs=0.1
), f"Basic Eval: Expected {rmse:0.1f} RMSE got {actual_rmse: 0.1f} RMSE"
assert actual_win_rmse == pytest.approx(
win_rmse, abs=0.1
), f"Windowed Eval: Expected {win_rmse:0.1f} RMSE got {actual_win_rmse:0.1f} RMSE"
assert actual_rmse == pytest.approx(rmse, abs=0.1), (
f"Basic Eval: Expected {rmse:0.1f} RMSE got {actual_rmse: 0.1f} RMSE"
)
assert actual_win_rmse == pytest.approx(win_rmse, abs=0.1), (
f"Windowed Eval: Expected {win_rmse:0.1f} RMSE got {actual_win_rmse:0.1f} RMSE"
)

with subtests.test(msg="save_and_load"):
subtest_save_and_load(learner, stream, True)
Expand Down

0 comments on commit 7b15fb8

Please sign in to comment.