From e0eb11ae6729cb6f6b82098c25f533db29fa56c9 Mon Sep 17 00:00:00 2001 From: Gerhardsa0 Date: Mon, 15 Jul 2024 17:01:19 +0200 Subject: [PATCH] linter changes --- tests/safeds/ml/nn/test_model.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/safeds/ml/nn/test_model.py b/tests/safeds/ml/nn/test_model.py index ca3afd123..2f28db782 100644 --- a/tests/safeds/ml/nn/test_model.py +++ b/tests/safeds/ml/nn/test_model.py @@ -53,7 +53,7 @@ def test_should_return_input_size(self, device: Device) -> None: ).fit( Table.from_dict({"a": [1], "b": [2]}).to_tabular_dataset("a"), ) - device.type + device.type #noqa assert model.input_size == 1 def test_should_raise_if_epoch_size_out_of_bounds(self, device: Device) -> None: @@ -264,7 +264,7 @@ def test_should_return_input_size(self, device: Device) -> None: Table.from_dict({"a": [1, 2, 3, 4], "b": [0, 1, 0, 1]}).to_tabular_dataset("b"), "accuracy", ) - device.type + device.type # noqa assert model.input_size == 1 def test_should_raise_if_epoch_size_out_of_bounds_when_fitting_by_exhaustive_search( @@ -334,6 +334,7 @@ def test_should_assert_that_is_fitted_is_set_correctly_and_check_return_type( self, metric: Literal["accuracy", "precision", "recall", "f1_score"], positive_class: Any, + device: Device ) -> None: model = NeuralNetworkClassifier(InputConversionTable(), [ForwardLayer(Choice(2, 4)), ForwardLayer(1)]) assert not model.is_fitted @@ -342,6 +343,7 @@ def test_should_assert_that_is_fitted_is_set_correctly_and_check_return_type( optimization_metric=metric, positive_class=positive_class, ) + device.type #noqa assert fitted_model.is_fitted assert isinstance(fitted_model, NeuralNetworkClassifier) @@ -617,7 +619,7 @@ def test_should_return_input_size(self, device: Device) -> None: ).fit( Table.from_dict({"a": [1], "b": [2]}).to_tabular_dataset("a"), ) - device.type + device.type # noqa assert model.input_size == 1 def test_should_raise_if_epoch_size_out_of_bounds(self, device: Device) -> None: @@ -809,7 +811,7 @@ def test_should_return_input_size(self, device: Device) -> None: Table.from_dict({"a": [1, 2, 3, 4], "b": [1.0, 2.0, 3.0, 4.0]}).to_tabular_dataset("b"), "mean_squared_error", ) - device.type + device.type # noqa assert model.input_size == 1 def test_should_raise_if_epoch_size_out_of_bounds_when_fitting_by_exhaustive_search( @@ -876,6 +878,7 @@ def test_should_assert_that_is_fitted_is_set_correctly_and_check_return_type( "median_absolute_deviation", "coefficient_of_determination", ], + device: Device ) -> None: model = NeuralNetworkRegressor(InputConversionTable(), [ForwardLayer(Choice(2, 4)), ForwardLayer(1)]) assert not model.is_fitted @@ -883,6 +886,7 @@ def test_should_assert_that_is_fitted_is_set_correctly_and_check_return_type( Table.from_dict({"a": [1, 2, 3, 4], "b": [1.0, 2.0, 3.0, 4.0]}).to_tabular_dataset("b"), optimization_metric=metric, ) + device.type #noqa assert fitted_model.is_fitted assert isinstance(fitted_model, NeuralNetworkRegressor)