Skip to content

Commit c870705

Browse files
committed
style: run ruff check & format
1 parent 174bd23 commit c870705

33 files changed

+21
-46
lines changed

benchmarks/table/row_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from timeit import timeit
22

33
import polars as pl
4+
from safeds.data.tabular.containers import Table
45

56
from benchmarks.table.utils import create_synthetic_table
6-
from safeds.data.tabular.containers import Table
77

88
REPETITIONS = 10
99

tests/safeds/data/image/containers/test_image.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
import pytest
77
import torch
8-
from syrupy import SnapshotAssertion
9-
from torch.types import Device
10-
118
from safeds._config import _get_device
129
from safeds.data.image.containers import Image
1310
from safeds.data.image.typing import ImageSize
1411
from safeds.data.tabular.containers import Table
1512
from safeds.exceptions import IllegalFormatError, OutOfBoundsError
13+
from syrupy import SnapshotAssertion
14+
from torch.types import Device
15+
1616
from tests.helpers import (
1717
configure_test_with_device,
1818
device_cpu,

tests/safeds/data/image/containers/test_image_list.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66

77
import pytest
88
import torch
9-
from syrupy import SnapshotAssertion
10-
from torch import Tensor
11-
from torch.types import Device
12-
139
from safeds.data.image.containers import Image, ImageList
1410
from safeds.data.image.containers._empty_image_list import _EmptyImageList
1511
from safeds.data.image.containers._multi_size_image_list import _MultiSizeImageList
1612
from safeds.data.image.containers._single_size_image_list import _SingleSizeImageList
1713
from safeds.data.tabular.containers import Table
1814
from safeds.exceptions import DuplicateIndexError, IllegalFormatError, IndexOutOfBoundsError, OutOfBoundsError
15+
from syrupy import SnapshotAssertion
16+
from torch import Tensor
17+
from torch.types import Device
18+
1919
from tests.helpers import (
2020
configure_test_with_device,
2121
device_cpu,

tests/safeds/data/labeled/containers/test_image_dataset.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ def test_get_batch_device(self, device: Device) -> None:
384384
@pytest.mark.parametrize("device", get_devices(), ids=get_devices_ids())
385385
@pytest.mark.parametrize("shuffle", [True, False])
386386
class TestSplit:
387-
388387
@pytest.mark.parametrize(
389388
"output",
390389
[

tests/safeds/data/tabular/containers/_cell/test_hash.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import polars as pl
44
import pytest
5-
65
from safeds.data.tabular.containers import Cell
76
from safeds.data.tabular.containers._lazy_cell import _LazyCell
87

tests/safeds/data/tabular/containers/_row/test_column_count.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
32
from safeds.data.tabular.containers import Table
43
from safeds.data.tabular.containers._lazy_vectorized_row import _LazyVectorizedRow
54

tests/safeds/data/tabular/containers/_row/test_column_names.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
32
from safeds.data.tabular.containers import Table
43
from safeds.data.tabular.containers._lazy_vectorized_row import _LazyVectorizedRow
54

tests/safeds/data/tabular/containers/_row/test_contains.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
32
from safeds.data.tabular.containers import Table
43
from safeds.data.tabular.containers._lazy_vectorized_row import _LazyVectorizedRow
54

tests/safeds/data/tabular/containers/_row/test_eq.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
32
from safeds.data.tabular.containers import Table
43
from safeds.data.tabular.containers._lazy_vectorized_row import _LazyVectorizedRow
54

tests/safeds/data/tabular/containers/_row/test_get_cell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import re
22

33
import pytest
4-
54
from safeds.data.tabular.containers import Table
65
from safeds.data.tabular.containers._lazy_vectorized_row import _LazyVectorizedRow
76
from safeds.exceptions import ColumnNotFoundError
7+
88
from tests.helpers import assert_row_operation_works
99

1010

tests/safeds/data/tabular/containers/_row/test_get_column_type.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
32
from safeds.data.tabular.containers import Table
43
from safeds.data.tabular.containers._lazy_vectorized_row import _LazyVectorizedRow
54
from safeds.data.tabular.typing import DataType

tests/safeds/data/tabular/containers/_row/test_getitem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import re
22

33
import pytest
4-
54
from safeds.data.tabular.containers import Table
65
from safeds.data.tabular.containers._lazy_vectorized_row import _LazyVectorizedRow
76
from safeds.exceptions import ColumnNotFoundError
7+
88
from tests.helpers import assert_row_operation_works
99

1010

tests/safeds/data/tabular/containers/_row/test_has_column.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
32
from safeds.data.tabular.containers import Table
43
from safeds.data.tabular.containers._lazy_vectorized_row import _LazyVectorizedRow
54

tests/safeds/data/tabular/containers/_row/test_hash.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
32
from safeds.data.tabular.containers import Table
43
from safeds.data.tabular.containers._lazy_vectorized_row import _LazyVectorizedRow
54

tests/safeds/data/tabular/containers/_row/test_iter.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
32
from safeds.data.tabular.containers import Table
43
from safeds.data.tabular.containers._lazy_vectorized_row import _LazyVectorizedRow
54

tests/safeds/data/tabular/containers/_row/test_len.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
32
from safeds.data.tabular.containers import Table
43
from safeds.data.tabular.containers._lazy_vectorized_row import _LazyVectorizedRow
54

tests/safeds/data/tabular/containers/_row/test_schema.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
32
from safeds.data.tabular.containers import Table
43
from safeds.data.tabular.containers._lazy_vectorized_row import _LazyVectorizedRow
54

tests/safeds/data/tabular/containers/_row/test_sizeof.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import sys
22

33
import polars as pl
4-
54
from safeds.data.tabular.containers._lazy_vectorized_row import _LazyVectorizedRow
65

76

tests/safeds/data/tabular/containers/_string_cell/test_hash.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import polars as pl
22
import pytest
3-
43
from safeds.data.tabular.containers import StringCell
54
from safeds.data.tabular.containers._lazy_string_cell import _LazyStringCell
65

tests/safeds/data/tabular/containers/_table/test_count_rows_if.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
32
from safeds.data.tabular.containers import Table
43

54

tests/safeds/data/tabular/containers/_table/test_join.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from typing import Literal
22

33
import pytest
4-
54
from safeds.data.tabular.containers import Table
65
from safeds.exceptions import ColumnNotFoundError
76

tests/safeds/data/tabular/containers/_table/test_remove_rows.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from typing import Any
22

33
import pytest
4-
54
from safeds.data.tabular.containers import Table
65

76

tests/safeds/data/tabular/containers/_temporal_cell/test_hash.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import polars as pl
22
import pytest
3-
43
from safeds.data.tabular.containers import TemporalCell
54
from safeds.data.tabular.containers._lazy_temporal_cell import _LazyTemporalCell
65

tests/safeds/data/tabular/plotting/test_plot_comparison.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import pytest
2-
from syrupy import SnapshotAssertion
3-
42
from safeds.data.tabular.containers import Table
3+
from syrupy import SnapshotAssertion
54

65

76
@pytest.mark.parametrize(

tests/safeds/data/tabular/transformation/test_k_nearest_neighbors_imputer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
32
from safeds.data.tabular.containers import Table
43
from safeds.data.tabular.transformation import KNearestNeighborsImputer
54
from safeds.exceptions import (

tests/safeds/data/tabular/transformation/test_sequential_table_transformer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616

1717
class TestInit:
18-
1918
def test_should_warn_on_empty_list(self) -> None:
2019
with pytest.warns(UserWarning, match=("transformers should contain at least 1 transformer")):
2120
SequentialTableTransformer(transformers=[]) # type: ignore[attr-defined]
@@ -137,7 +136,6 @@ def test_should_return_true_after_fitting(self) -> None:
137136

138137

139138
class TestInverseTransform:
140-
141139
@pytest.mark.parametrize(
142140
"transformers",
143141
[

tests/safeds/ml/classical/classification/test_classifier.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ def valid_data() -> TabularDataset:
102102

103103
@pytest.mark.parametrize("classifier_with_choice", classifiers_with_choices(), ids=lambda x: x.__class__.__name__)
104104
class TestChoiceClassifiers:
105-
106105
def test_should_raise_if_model_is_fitted_with_choice(
107106
self,
108107
classifier_with_choice: Classifier,
@@ -131,7 +130,6 @@ def test_workflow_with_choice_parameter(
131130

132131

133132
class TestFitByExhaustiveSearch:
134-
135133
@pytest.mark.parametrize("classifier", classifiers(), ids=lambda x: x.__class__.__name__)
136134
def test_should_raise_if_model_is_fitted_by_exhaustive_search_without_choice(
137135
self,

tests/safeds/ml/classical/regression/test_regressor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ def valid_data() -> TabularDataset:
110110

111111
@pytest.mark.parametrize("regressor_with_choice", regressors_with_choices(), ids=lambda x: x.__class__.__name__)
112112
class TestChoiceRegressors:
113-
114113
def test_workflow_with_choice_parameter(self, regressor_with_choice: Regressor, valid_data: TabularDataset) -> None:
115114
model = regressor_with_choice.fit_by_exhaustive_search(valid_data, RegressorMetric.MEAN_SQUARED_ERROR)
116115
assert isinstance(model, type(regressor_with_choice))

tests/safeds/ml/nn/test_cnn_workflow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
import pytest
55
import torch
6-
from torch.types import Device
7-
86
from safeds._config import _get_device
97
from safeds.data.image.containers import ImageList
108
from safeds.data.image.containers._single_size_image_list import _SingleSizeImageList
@@ -29,6 +27,8 @@
2927
MaxPooling2DLayer,
3028
)
3129
from safeds.ml.nn.typing import VariableImageSize
30+
from torch.types import Device
31+
3232
from tests.helpers import configure_test_with_device, device_cpu, device_cuda, images_all, resolve_resource_path
3333

3434
if TYPE_CHECKING:

tests/safeds/ml/nn/test_dropout_workflow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import pytest
2-
from torch.types import Device
3-
42
from safeds._config import _get_device
53
from safeds.data.tabular.containers import Table
64
from safeds.ml.nn import (
@@ -13,6 +11,8 @@
1311
DropoutLayer,
1412
ForwardLayer,
1513
)
14+
from torch.types import Device
15+
1616
from tests.helpers import configure_test_with_device, get_devices, get_devices_ids
1717

1818

tests/safeds/ml/nn/test_forward_workflow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import pytest
2-
from torch.types import Device
3-
42
from safeds._config import _get_device
53
from safeds.data.tabular.containers import Table
64
from safeds.data.tabular.transformation import StandardScaler
@@ -13,6 +11,8 @@
1311
from safeds.ml.nn.layers import (
1412
ForwardLayer,
1513
)
14+
from torch.types import Device
15+
1616
from tests.helpers import configure_test_with_device, get_devices, get_devices_ids, resolve_resource_path
1717

1818

tests/safeds/ml/nn/test_lstm_workflow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import pytest
2-
from torch.types import Device
3-
42
from safeds._config import _get_device
53
from safeds.data.tabular.containers import Table
64
from safeds.data.tabular.transformation import RangeScaler
@@ -15,6 +13,8 @@
1513
GRULayer,
1614
LSTMLayer,
1715
)
16+
from torch.types import Device
17+
1818
from tests.helpers import configure_test_with_device, get_devices, get_devices_ids, resolve_resource_path
1919

2020

tests/safeds/ml/nn/test_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
import re
33

44
import pytest
5-
from torch.types import Device
6-
75
from safeds.data.image.typing import ImageSize
86
from safeds.data.labeled.containers import TabularDataset
97
from safeds.data.tabular.containers import Table
@@ -39,6 +37,8 @@
3937
MaxPooling2DLayer,
4038
)
4139
from safeds.ml.nn.typing import VariableImageSize
40+
from torch.types import Device
41+
4242
from tests.helpers import configure_test_with_device, get_devices, get_devices_ids
4343

4444

0 commit comments

Comments
 (0)