Skip to content

Commit

Permalink
isort
Browse files Browse the repository at this point in the history
  • Loading branch information
samet-akcay committed Mar 22, 2023
1 parent b90ca5a commit 9083f0c
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 25 deletions.
1 change: 0 additions & 1 deletion tests/unit/data/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from .test_image import _TestAnomalibImageDatamodule
from .test_video import _TestAnomalibVideoDatamodule


__all__ = [
"_TestAnomalibDataModule",
"_TestAnomalibDepthDatamodule",
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/data/base/test_datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
# SPDX-License-Identifier: Apache-2.0


from anomalib.data import AnomalibDataModule
import pytest
from torch.utils.data import DataLoader

from anomalib.data import AnomalibDataModule


class _TestAnomalibDataModule:
"""Base test class for ``AnomalibDataModule``.
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/data/base/test_depth.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

from anomalib.data import AnomalibDataModule
import pytest

from anomalib.data import AnomalibDataModule

from .test_datamodule import _TestAnomalibDataModule


Expand Down
2 changes: 2 additions & 0 deletions tests/unit/data/base/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
# SPDX-License-Identifier: Apache-2.0

import pytest

from anomalib.data import AnomalibDataModule

from .test_datamodule import _TestAnomalibDataModule


Expand Down
2 changes: 2 additions & 0 deletions tests/unit/data/base/test_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
# SPDX-License-Identifier: Apache-2.0

import pytest

from anomalib.data import AnomalibDataModule

from .test_datamodule import _TestAnomalibDataModule


Expand Down
3 changes: 2 additions & 1 deletion tests/unit/data/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

from anomalib.data import TaskType
import pytest

from anomalib.data import TaskType


@pytest.fixture(params=[TaskType.CLASSIFICATION, TaskType.DETECTION, TaskType.SEGMENTATION])
def task_type(request) -> str:
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/data/test_avenue.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
# SPDX-License-Identifier: Apache-2.0

import os
from anomalib.data import Avenue, TaskType

import pytest
from .base import _TestAnomalibVideoDatamodule

from anomalib.data import Avenue, TaskType
from tests.helpers.dataset import get_dataset_path

from .base import _TestAnomalibVideoDatamodule


class TestAvenue(_TestAnomalibVideoDatamodule):
"""Avenue Datamodule Unit Tests."""
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/data/test_btech.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

from anomalib.data import BTech, TaskType
import pytest
from .base import _TestAnomalibImageDatamodule

from anomalib.data import BTech, TaskType
from tests.helpers.dataset import get_dataset_path

from .base import _TestAnomalibImageDatamodule


class TestBTech(_TestAnomalibImageDatamodule):
"""MVTec Datamodule Unit Tests."""
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/data/test_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

from anomalib.data import Folder, TaskType
from .base import _TestAnomalibImageDatamodule
import pytest

from anomalib.data import Folder, TaskType
from tests.helpers.dataset import get_dataset_path

from .base import _TestAnomalibImageDatamodule


class TestFolder(_TestAnomalibImageDatamodule):
"""Folder Datamodule Unit Tests.
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/data/test_folder_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

from anomalib.data import Folder3D, TaskType
import pytest
from .base import _TestAnomalibDepthDatamodule

from anomalib.data import Folder3D, TaskType
from tests.helpers.dataset import get_dataset_path

from .base import _TestAnomalibDepthDatamodule


class TestFolder3D(_TestAnomalibDepthDatamodule):
"""Folder3D Datamodule Unit Tests."""
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/data/test_mvtec.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

from anomalib.data import MVTec, TaskType
import pytest
from .base import _TestAnomalibImageDatamodule

from anomalib.data import MVTec, TaskType
from tests.helpers.dataset import get_dataset_path

from .base import _TestAnomalibImageDatamodule


class TestMVTec(_TestAnomalibImageDatamodule):
"""MVTec Datamodule Unit Tests."""
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/data/test_mvtec_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

from anomalib.data import MVTec3D, TaskType
import pytest
from .base import _TestAnomalibDepthDatamodule

from anomalib.data import MVTec3D, TaskType
from tests.helpers.dataset import get_dataset_path

from .base import _TestAnomalibDepthDatamodule


class TestMVTec3D(_TestAnomalibDepthDatamodule):
"""MVTec Datamodule Unit Tests."""
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/data/test_shanghaitech.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

from anomalib.data import ShanghaiTech, TaskType
import pytest

from anomalib.data import ShanghaiTech, TaskType
from anomalib.data.utils.split import ValSplitMode
from .base import _TestAnomalibVideoDatamodule

from tests.helpers.dataset import get_dataset_path

from .base import _TestAnomalibVideoDatamodule


class TestShanghaiTech(_TestAnomalibVideoDatamodule):
"""ShanghaiTech Datamodule Unit Tests."""
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/data/test_ucsd_ped.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

from anomalib.data import UCSDped, TaskType
import pytest
from .base import _TestAnomalibVideoDatamodule


from anomalib.data import TaskType, UCSDped
from tests.helpers.dataset import get_dataset_path

from .base import _TestAnomalibVideoDatamodule


class TestUCSDped(_TestAnomalibVideoDatamodule):
"""UCSDped Datamodule Unit Tests."""
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/data/test_visa.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

from anomalib.data import Visa, TaskType
import pytest
from .base import _TestAnomalibImageDatamodule


from anomalib.data import TaskType, Visa
from tests.helpers.dataset import get_dataset_path

from .base import _TestAnomalibImageDatamodule


class TestVisa(_TestAnomalibImageDatamodule):
"""Visa Datamodule Unit Tests."""
Expand Down

0 comments on commit 9083f0c

Please sign in to comment.